[FFmpeg-cvslog] avcodec/dnxhddec: ignore second flag for encoded field

Paul B Mahol git at videolan.org
Wed Aug 25 23:49:15 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Aug 25 22:36:32 2021 +0200| [507fdcd1b09deed0cfd274d6afb284a99963168f] | committer: Paul B Mahol

avcodec/dnxhddec: ignore second flag for encoded field

And instead use previous field flag.

Fixes decoding files produced by non-compliant encoders.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=507fdcd1b09deed0cfd274d6afb284a99963168f
---

 libavcodec/dnxhddec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 41c72cdce6..d113c1db7b 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -193,7 +193,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
         return AVERROR_INVALIDDATA;
     }
     if (buf[5] & 2) { /* interlaced */
-        ctx->cur_field = buf[5] & 1;
+        ctx->cur_field = first_field ? buf[5] & 1 : !ctx->cur_field;
         frame->interlaced_frame = 1;
         frame->top_field_first  = first_field ^ ctx->cur_field;
         av_log(ctx->avctx, AV_LOG_DEBUG,



More information about the ffmpeg-cvslog mailing list