diff --git a/torchvision/csrc/io/decoder/audio_stream.cpp b/torchvision/csrc/io/decoder/audio_stream.cpp index 9d66e589bf3..f6507130bda 100644 --- a/torchvision/csrc/io/decoder/audio_stream.cpp +++ b/torchvision/csrc/io/decoder/audio_stream.cpp @@ -7,13 +7,13 @@ namespace ffmpeg { namespace { bool operator==(const AudioFormat& x, const AVFrame& y) { - return x.samples == y.sample_rate && x.channels == y.channels && - x.format == y.format; + return static_cast(x.samples) == y.sample_rate && + static_cast(x.channels) == y.channels && x.format == y.format; } bool operator==(const AudioFormat& x, const AVCodecContext& y) { - return x.samples == y.sample_rate && x.channels == y.channels && - x.format == y.sample_fmt; + return static_cast(x.samples) == y.sample_rate && + static_cast(x.channels) == y.channels && x.format == y.sample_fmt; } AudioFormat& toAudioFormat(AudioFormat& x, const AVFrame& y) { diff --git a/torchvision/csrc/io/decoder/decoder.cpp b/torchvision/csrc/io/decoder/decoder.cpp index 6c9a3cdf825..18e49a4d002 100644 --- a/torchvision/csrc/io/decoder/decoder.cpp +++ b/torchvision/csrc/io/decoder/decoder.cpp @@ -196,8 +196,6 @@ int64_t Decoder::seekCallback(int64_t offset, int whence) { void Decoder::initOnce() { static std::once_flag flagInit; std::call_once(flagInit, []() { - av_register_all(); - avcodec_register_all(); avformat_network_init(); // register ffmpeg lock manager av_lockmgr_register(&ffmpeg_lock); @@ -397,10 +395,10 @@ bool Decoder::init( } bool Decoder::openStreams(std::vector* metadata) { - for (int i = 0; i < inputCtx_->nb_streams; i++) { + for (int i = 0; i < static_cast(inputCtx_->nb_streams); i++) { // - find the corespondent format at params_.formats set 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)) { VLOG(1) << "Stream media: " << media << " at index " << i << " gets ignored, unknown type";