Unified · Split
| @@ -396,12 +396,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) · 395 unmodified lines | ||
| 396 | 396 | copy_picture_field(tinterlace, out->data, out->linesize, |
| 397 | 397 | (const uint8_t **)cur->data, cur->linesize, |
| 398 | 398 | inlink->format, inlink->w, inlink->h, |
| 399 | − FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_LOWER : FIELD_UPPER : FIELD_UPPER, tinterlace->flags); | |
| 399 | + FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? (1 + inlink->frame_count_out) & 1 ? FIELD_LOWER : FIELD_UPPER : FIELD_UPPER, tinterlace->flags); | |
| 400 | 400 | /* write even frame lines into the lower field of the new frame */ |
| 401 | 401 | copy_picture_field(tinterlace, out->data, out->linesize, |
| 402 | 402 | (const uint8_t **)next->data, next->linesize, |
| 403 | 403 | inlink->format, inlink->w, inlink->h, |
| 404 | − FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_UPPER : FIELD_LOWER : FIELD_LOWER, tinterlace->flags); | |
| 404 | + FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? (1 + inlink->frame_count_out) & 1 ? FIELD_UPPER : FIELD_LOWER : FIELD_LOWER, tinterlace->flags); | |
| 405 | 405 | if (tinterlace->mode != MODE_MERGEX2) |
| 406 | 406 | av_frame_free(&tinterlace->next); |
| 407 | 407 | break; |