And instead use previous field flag. Fixes decoding files produced by non-compliant encoders.
Unified · Split
| @@ -193,7 +193,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, · 192 unmodified lines | |||
| 193 | return AVERROR_INVALIDDATA; | 193 | return AVERROR_INVALIDDATA; |
| 194 | } | 194 | } |
| 195 | if (buf[5] & 2) { /* interlaced */ | 195 | if (buf[5] & 2) { /* interlaced */ |
| 196 | ctx->cur_field = buf[5] & 1; | 196 | ctx->cur_field = first_field ? buf[5] & 1 : !ctx->cur_field; |
| 197 | frame->interlaced_frame = 1; | 197 | frame->interlaced_frame = 1; |
| 198 | frame->top_field_first = first_field ^ ctx->cur_field; | 198 | frame->top_field_first = first_field ^ ctx->cur_field; |
| 199 | av_log(ctx->avctx, AV_LOG_DEBUG, | 199 | av_log(ctx->avctx, AV_LOG_DEBUG, |