]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mxpegdec.c
Drop some pointless #ifdefs.
[ffmpeg] / libavcodec / mxpegdec.c
index 7d6f7593339f71a6af24ea0617d03b30956367a6..c00997007ae2f547c2c43c8cd8d03f8dabf58fc4 100644 (file)
@@ -47,9 +47,7 @@ static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
 
     s->picture[0].reference = s->picture[1].reference = 3;
     s->jpg.picture_ptr      = &s->picture[0];
-    ff_mjpeg_decode_init(avctx);
-
-    return 0;
+    return ff_mjpeg_decode_init(avctx);
 }
 
 static int mxpeg_decode_app(MXpegDecodeContext *s,
@@ -255,11 +253,11 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
                         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
                         return AVERROR(ENOMEM);
                     }
-                    jpg->picture_ptr->pict_type = FF_P_TYPE;
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_P;
                     jpg->picture_ptr->key_frame = 0;
                     jpg->got_picture = 1;
                 } else {
-                    jpg->picture_ptr->pict_type = FF_I_TYPE;
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
                     jpg->picture_ptr->key_frame = 1;
                 }
 
@@ -275,9 +273,13 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
                         return AVERROR(ENOMEM);
                     }
 
-                    ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
+                    ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
+                    if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+                        return ret;
                 } else {
-                    ff_mjpeg_decode_sos(jpg, NULL, NULL);
+                    ret = ff_mjpeg_decode_sos(jpg, NULL, NULL);
+                    if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+                        return ret;
                 }
 
                 break;
@@ -336,5 +338,5 @@ AVCodec ff_mxpeg_decoder = {
     .close          = mxpeg_decode_end,
     .decode         = mxpeg_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-    .max_lowres     = 3
+    .max_lowres     = 3,
 };