"src/git@developer.sourcefind.cn:one/TransferBench.git" did not exist on "b721550223bf843d6d651e1de39b3b1afa95f8d2"
Unverified Commit f6b6b510 authored by Bruno Korbar's avatar Bruno Korbar Committed by GitHub
Browse files

addressing #3805: remove deprecated function call 3 (#3861)



* remove unused functions

* shut up annoying warnings via cast

* prabhat's comments

* Fixed clang format error
Co-authored-by: default avatarPrabhat Roy <prabhatroy@fb.com>
parent 8e8c6658
...@@ -7,13 +7,13 @@ namespace ffmpeg { ...@@ -7,13 +7,13 @@ namespace ffmpeg {
namespace { namespace {
bool operator==(const AudioFormat& x, const AVFrame& y) { bool operator==(const AudioFormat& x, const AVFrame& y) {
return x.samples == y.sample_rate && x.channels == y.channels && return static_cast<int>(x.samples) == y.sample_rate &&
x.format == y.format; static_cast<int>(x.channels) == y.channels && x.format == y.format;
} }
bool operator==(const AudioFormat& x, const AVCodecContext& y) { bool operator==(const AudioFormat& x, const AVCodecContext& y) {
return x.samples == y.sample_rate && x.channels == y.channels && return static_cast<int>(x.samples) == y.sample_rate &&
x.format == y.sample_fmt; static_cast<int>(x.channels) == y.channels && x.format == y.sample_fmt;
} }
AudioFormat& toAudioFormat(AudioFormat& x, const AVFrame& y) { AudioFormat& toAudioFormat(AudioFormat& x, const AVFrame& y) {
......
...@@ -196,8 +196,6 @@ int64_t Decoder::seekCallback(int64_t offset, int whence) { ...@@ -196,8 +196,6 @@ int64_t Decoder::seekCallback(int64_t offset, int whence) {
void Decoder::initOnce() { void Decoder::initOnce() {
static std::once_flag flagInit; static std::once_flag flagInit;
std::call_once(flagInit, []() { std::call_once(flagInit, []() {
av_register_all();
avcodec_register_all();
avformat_network_init(); avformat_network_init();
// register ffmpeg lock manager // register ffmpeg lock manager
av_lockmgr_register(&ffmpeg_lock); av_lockmgr_register(&ffmpeg_lock);
...@@ -397,10 +395,10 @@ bool Decoder::init( ...@@ -397,10 +395,10 @@ bool Decoder::init(
} }
bool Decoder::openStreams(std::vector<DecoderMetadata>* metadata) { bool Decoder::openStreams(std::vector<DecoderMetadata>* metadata) {
for (int i = 0; i < inputCtx_->nb_streams; i++) { for (int i = 0; i < static_cast<int>(inputCtx_->nb_streams); i++) {
// - find the corespondent format at params_.formats set // - find the corespondent format at params_.formats set
MediaFormat format; MediaFormat format;
const auto media = inputCtx_->streams[i]->codec->codec_type; const auto media = inputCtx_->streams[i]->codecpar->codec_type;
if (!mapFfmpegType(media, &format.type)) { if (!mapFfmpegType(media, &format.type)) {
VLOG(1) << "Stream media: " << media << " at index " << i VLOG(1) << "Stream media: " << media << " at index " << i
<< " gets ignored, unknown type"; << " gets ignored, unknown type";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment