]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mjpegdec.c
adxdec: clear eof flag and channel states when seeking
[ffmpeg] / libavcodec / mjpegdec.c
index 592dfe75b727299d31a36490c40b17bd91d91fc2..058b08fa83cf8971f66d261a536d51e20f470005 100644 (file)
@@ -110,12 +110,9 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
             return AVERROR_INVALIDDATA;
         }
     }
-    if (avctx->extradata_size > 9 &&
-        AV_RL32(avctx->extradata + 4) == MKTAG('f','i','e','l')) {
-        if (avctx->extradata[9] == 6) { /* quicktime icefloe 019 */
-            s->interlace_polarity = 1; /* bottom field first */
-            av_log(avctx, AV_LOG_DEBUG, "mjpeg bottom field first\n");
-        }
+    if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
+        s->interlace_polarity = 1; /* bottom field first */
+        av_log(avctx, AV_LOG_DEBUG, "mjpeg bottom field first\n");
     }
     if (avctx->codec->id == CODEC_ID_AMV)
         s->flipped = 1;
@@ -1109,9 +1106,9 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
         av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id);
     }
 
-    /* buggy AVID, it puts EOI only at every 10th frame */
-    /* also this fourcc is used by non-avid files too, it holds some
-       informations, but it's always present in AVID creates files */
+    /* Buggy AVID, it puts EOI only at every 10th frame. */
+    /* Also, this fourcc is used by non-avid files too, it holds some
+       information, but it's always present in AVID-created files. */
     if (id == AV_RL32("AVI1"))
     {
         /* structure:
@@ -1531,7 +1528,7 @@ eoi_parser:
                         break;
                     }
                     if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 &&
-                        avctx->error_recognition >= FF_ER_EXPLODE)
+                        (avctx->err_recognition & AV_EF_EXPLODE))
                       return AVERROR_INVALIDDATA;
                     /* buggy avid puts EOI every 10-20th frame */
                     /* if restart period is over process EOI */