ffmpeg | branch: master | Paul B Mahol <[email protected]> | 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,

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to