Skip to content

Commit

Permalink
video: make --field-dominance set interlaced flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmitch committed Sep 10, 2015
1 parent b4abcbd commit a6de77a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,10 @@ Video
:top: top field first
:bottom: bottom field first

.. note::

Setting either :top: or :bottom: will flag all frames as interlaced.

``--frames=<number>``
Play/convert only first ``<number>`` video frames, then quit.

Expand Down
10 changes: 6 additions & 4 deletions video/decode/dec_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,13 @@ struct mp_image *video_decode(struct dec_video *d_video,
return NULL; // error / skipped frame
}

if (opts->field_dominance == 0)
mpi->fields |= MP_IMGFIELD_TOP_FIRST;
else if (opts->field_dominance == 1)
if (opts->field_dominance == 0) {
mpi->fields |= MP_IMGFIELD_TOP_FIRST | MP_IMGFIELD_INTERLACED;
} else if (opts->field_dominance == 1) {
mpi->fields &= ~MP_IMGFIELD_TOP_FIRST;

mpi->fields |= MP_IMGFIELD_INTERLACED;
}

// Note: the PTS is reordered, but the DTS is not. Both should be monotonic.
double pts = d_video->codec_pts;
double dts = d_video->codec_dts;
Expand Down

0 comments on commit a6de77a

Please sign in to comment.