avformat/utils: Find a fallback probe decoder that will also match a forced decoder...
authorSamuel Foss <sfoss@google.com>
Wed, 3 Jun 2020 11:15:28 +0000 (07:15 -0400)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 4 Jun 2020 17:22:29 +0000 (19:22 +0200)
Prevent codecpar->codec_id from getting out of sync with the codec instantiated for probing.

Signed-off-by: Samuel Foss <sfoss@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/utils.c

index c938531..b3d902c 100644 (file)
@@ -219,7 +219,7 @@ static const AVCodec *find_probe_decoder(AVFormatContext *s, const AVStream *st,
         const AVCodec *probe_codec = NULL;
         void *iter = NULL;
         while ((probe_codec = av_codec_iterate(&iter))) {
-            if (probe_codec->id == codec_id &&
+            if (probe_codec->id == codec->id &&
                     av_codec_is_decoder(probe_codec) &&
                     !(probe_codec->capabilities & (AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_EXPERIMENTAL))) {
                 return probe_codec;