]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/v410dec.c
libavutil: drop offsetof() fallback definition
[ffmpeg] / libavcodec / v410dec.c
index 54c95958265f5eb8d28e4c7d434dc66c03a8c244..d23c590462ea5abf7be694dfa01a59238ffe9387 100644 (file)
@@ -29,8 +29,12 @@ static av_cold int v410_decode_init(AVCodecContext *avctx)
     avctx->bits_per_raw_sample = 10;
 
     if (avctx->width & 1) {
-        av_log(avctx, AV_LOG_ERROR, "v410 requires even width.\n");
-        return AVERROR_INVALIDDATA;
+        if (avctx->err_recognition & AV_EF_EXPLODE) {
+            av_log(avctx, AV_LOG_ERROR, "v410 requires width to be even.\n");
+            return AVERROR_INVALIDDATA;
+        } else {
+            av_log(avctx, AV_LOG_WARNING, "v410 requires width to be even, continuing anyway.\n");
+        }
     }
 
     avctx->coded_frame = avcodec_alloc_frame();
@@ -68,7 +72,7 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data,
     }
 
     pic->key_frame = 1;
-    pic->pict_type = FF_I_TYPE;
+    pic->pict_type = AV_PICTURE_TYPE_I;
 
     y = (uint16_t *)pic->data[0];
     u = (uint16_t *)pic->data[1];
@@ -109,7 +113,7 @@ static av_cold int v410_decode_close(AVCodecContext *avctx)
 AVCodec ff_v410_decoder = {
     .name         = "v410",
     .type         = AVMEDIA_TYPE_VIDEO,
-    .id           = CODEC_ID_V410,
+    .id           = AV_CODEC_ID_V410,
     .init         = v410_decode_init,
     .decode       = v410_decode_frame,
     .close        = v410_decode_close,