Hi! Peter Bubestinger provided a C210 file where every frame starts with 64 bytes of extradata (24 byte "INFO", 16 byte "RDRT", rest "FIEL"). Piotr confirmed that the Canopus decoder accepts files without the extradata but consumes it if present. Attached patch fixes the file in question visually.
Please comment, Carl Eugen
From 42b101a00cc1d78ee6a5207ac09546b67adf7fe5 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos <ceffm...@gmail.com> Date: Thu, 10 May 2018 22:45:07 +0200 Subject: [PATCH] lavc/v210dec: Skip Canopus C210 extradata. Unbreaks files with unknown extradata. --- libavcodec/v210dec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index 99199dd..ddc5dbe 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -27,6 +27,7 @@ #include "libavutil/bswap.h" #include "libavutil/internal.h" #include "libavutil/mem.h" +#include "libavutil/intreadwrite.h" #define READ_PIXELS(a, b, c) \ do { \ @@ -92,6 +93,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return AVERROR_INVALIDDATA; } } + if ( avctx->codec_tag == MKTAG('C', '2', '1', '0') + && avpkt->size > 64 + && AV_RN32(psrc) == AV_RN32("INFO") + && avpkt->size - 64 >= stride * avctx->height) + psrc += 64; aligned_input = !((uintptr_t)psrc & 0xf) && !(stride & 0xf); if (aligned_input != s->aligned_input) { -- 1.7.10.4
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel