diff options
-rw-r--r-- | DOCS/man/en/options.rst | 11 | ||||
-rw-r--r-- | demux/demux_mkv.c | 2 | ||||
-rw-r--r-- | mpvcore/options.c | 1 | ||||
-rw-r--r-- | video/decode/dec_video.c | 5 |
4 files changed, 13 insertions, 6 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index 02be5b86f4..fec8aa0575 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -1630,16 +1630,19 @@ OPTIONS Use the given profile(s), ``--profile=help`` displays a list of the defined profiles. -``--pts-association-mode=<auto|decode|sort>`` +``--pts-association-mode=<decode|sort|auto>`` Select the method used to determine which container packet timestamp corresponds to a particular output frame from the video decoder. Normally you should not need to change this option. - :auto: Try to pick a working mode from the ones below automatically - (default) - :decoder: Use decoder reordering functionality. + :decoder: Use decoder reordering functionality. Unlike in classic MPlayer + and mplayer2, this includes a dTS fallback. (Default.) :sort: Maintain a buffer of unused pts values and use the lowest value for the frame. + :auto: Try to pick a working mode from the ones above automatically. + + You can also try to use ``--no-correct-pts`` for files with completely + broken timestamps. ``--pvr=<option1:option2:...>`` This option tunes various encoding properties of the PVR capture module. diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 2199a9c932..ec98bc81a9 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -2373,6 +2373,8 @@ static int handle_block(demuxer_t *demuxer, struct block_info *block_info) * values being the same) */ if (i == 0 || track->default_duration) dp->pts = mkv_d->last_pts + i * track->default_duration; + if (track->ms_compat) + MPSWAP(double, dp->pts, dp->dts); dp->duration = block_duration / 1e9; demuxer_add_packet(demuxer, stream, dp); } diff --git a/mpvcore/options.c b/mpvcore/options.c index 1eec14284d..11819c5286 100644 --- a/mpvcore/options.c +++ b/mpvcore/options.c @@ -811,6 +811,7 @@ const struct MPOpts mp_default_opts = { .edition_id = -1, .default_max_pts_correction = -1, .correct_pts = 1, + .user_pts_assoc_mode = 1, .initial_audio_sync = 1, .term_osd = 2, .consolecontrols = 1, diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index d2479a7610..d0d7355803 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -211,12 +211,13 @@ struct mp_image *video_decode(struct dec_video *d_video, { mp_image_t *mpi = NULL; struct MPOpts *opts = d_video->opts; + bool sort_pts = opts->user_pts_assoc_mode != 1 && opts->correct_pts; double pts = packet ? packet->pts : MP_NOPTS_VALUE; if (pts != MP_NOPTS_VALUE) d_video->last_packet_pts = pts; - if (opts->correct_pts && pts != MP_NOPTS_VALUE) { + if (sort_pts && pts != MP_NOPTS_VALUE) { int delay = -1; video_vd_control(d_video, VDCTRL_QUERY_UNSEEN_FRAMES, &delay); if (delay >= 0) { @@ -270,7 +271,7 @@ struct mp_image *video_decode(struct dec_video *d_video, || pts == MP_NOPTS_VALUE) d_video->num_reordered_pts_problems++; prevpts = d_video->sorted_pts; - if (opts->correct_pts) { + if (sort_pts) { if (d_video->num_buffered_pts) { d_video->num_buffered_pts--; d_video->sorted_pts = |