mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 20:00:56 +00:00
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.
This commit is contained in:
parent
98388c0c07
commit
1bfae45a88
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user