diff options
author | wm4 <wm4@nowhere> | 2013-06-22 01:31:25 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-25 00:11:56 +0200 |
commit | 1bfae45a88ac7c24b74a6f7ca6eb4aa27d20c653 (patch) | |
tree | 4eeb431e705999e1501a68c3b5ac8c4a7bfa728d | |
parent | 98388c0c073906f4485420485e27a14e8d957a2d (diff) | |
download | mpv-1bfae45a88ac7c24b74a6f7ca6eb4aa27d20c653.tar.bz2 mpv-1bfae45a88ac7c24b74a6f7ca6eb4aa27d20c653.tar.xz |
core: don't set correct-pts mode randomly
The default correct-pts mode depended on which demuxer was opened last.
Often this is the subtitle demuxer. The correct-pts mode should be
decided on the demuxer for video instead.
-rw-r--r-- | core/mplayer.c | 8 | ||||
-rw-r--r-- | demux/demux.c | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index f766246f63..67d82fdb35 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -4289,6 +4289,14 @@ goto_reopen_demuxer: ; if (mpctx->timeline) timeline_set_part(mpctx, mpctx->timeline_part, true); + // Decide correct-pts mode based on first segment of video track + opts->correct_pts = opts->user_correct_pts; + if (opts->correct_pts < 0) { + opts->correct_pts = + demux_control(mpctx->demuxer, DEMUXER_CTRL_CORRECT_PTS, + NULL) == DEMUXER_CTRL_OK; + } + mpctx->initialized_flags |= INITIALIZED_DEMUXER; add_subtitle_fonts_from_sources(mpctx); diff --git a/demux/demux.c b/demux/demux.c index 379a74f654..369e7f3226 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -981,11 +981,6 @@ static struct demuxer *open_given_type(struct MPOpts *opts, demuxer = demux2; } demuxer->file_format = fformat; - opts->correct_pts = opts->user_correct_pts; - if (opts->correct_pts < 0) - opts->correct_pts = - demux_control(demuxer, DEMUXER_CTRL_CORRECT_PTS, - NULL) == DEMUXER_CTRL_OK; if (stream_manages_timeline(demuxer->stream)) { // Incorrect, but fixes some behavior with DVD/BD demuxer->ts_resets_possible = false; |