avcodec/dnxhddec: ignore second flag for encoded field

And instead use previous field flag.

Fixes decoding files produced by non-compliant encoders.
This commit is contained in:
Paul B Mahol 2021-08-25 22:36:32 +02:00
parent 2589060b92
commit 507fdcd1b0
1 changed files with 1 additions and 1 deletions

View File

@ -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,