options: simplify --correct-pts handling

Remove the (now unused) code for determining correct-pts mode based on
the demuxer in use. Change its description in the manpage to reflect
what this option does now.
This commit is contained in:
wm4 2013-07-26 02:06:58 +02:00
parent fb67770ed6
commit 3bddc16431
6 changed files with 9 additions and 20 deletions

View File

@ -547,13 +547,12 @@
format.
``--correct-pts``, ``--no-correct-pts``
Switches mpv to a mode where timestamps for video frames are calculated
differently and video filters which add new frames or modify timestamps of
existing ones are supported. Now enabled automatically for most common file
formats. The more accurate timestamps can be visible for example when
playing subtitles timed to scene changes with the ``--ass`` option. Without
``--correct-pts``, the subtitle timing will typically be off by some frames.
This option does not work correctly with some demuxers and codecs.
``--no-correct-pts`` switches mpv to a mode where video timing is
determined using a fixed framerate value (either using the ``--fps``
option, or using file information). Sometimes, files with very broken
timestamps can be played somewhat well in this mode. Note that video
filters, subtitle rendering and audio synchronization can be completely
broken in this mode.
``--cursor-autohide=<number|no|always>``
Make mouse cursor automatically hide after given number of milliseconds.

View File

@ -4263,14 +4263,6 @@ 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) {
int val = 1;
demux_control(mpctx->demuxer, DEMUXER_CTRL_CORRECT_PTS, &val);
opts->correct_pts = val;
}
mpctx->initialized_flags |= INITIALIZED_DEMUXER;
add_subtitle_fonts_from_sources(mpctx);

View File

@ -648,7 +648,7 @@ const m_option_t mp_opts[] = {
OPT_INTRANGE("chapter-merge-threshold", chapter_merge_threshold, 0, 0, 10000),
// a-v sync stuff:
OPT_FLAG("correct-pts", user_correct_pts, 0),
OPT_FLAG("correct-pts", correct_pts, 0),
OPT_CHOICE("pts-association-mode", user_pts_assoc_mode, 0,
({"auto", 0}, {"decoder", 1}, {"sort", 2})),
OPT_FLAG("initial-audio-sync", initial_audio_sync, 0),
@ -764,7 +764,7 @@ const struct MPOpts mp_default_opts = {
.chapterrange = {-1, -1},
.edition_id = -1,
.default_max_pts_correction = -1,
.user_correct_pts = -1,
.correct_pts = 1,
.initial_audio_sync = 1,
.term_osd = 2,
.consolecontrols = 1,

View File

@ -94,7 +94,6 @@ typedef struct MPOpts {
int chapterrange[2];
int edition_id;
int correct_pts;
int user_correct_pts;
int user_pts_assoc_mode;
int initial_audio_sync;
int hr_seek;

View File

@ -63,7 +63,6 @@ enum timestamp_type {
#define DEMUXER_CTRL_RESYNC 13
#define DEMUXER_CTRL_SWITCH_VIDEO 14
#define DEMUXER_CTRL_IDENTIFY_PROGRAM 15
#define DEMUXER_CTRL_CORRECT_PTS 16 // int* (write 1 for ok, 0 for no)
#define SEEK_ABSOLUTE (1 << 0)
#define SEEK_FACTOR (1 << 1)

View File

@ -531,7 +531,7 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
demuxer->timestamp_type = TIMESTAMP_TYPE_SORT;
} else {
int mode = lavfdopts->genptsmode;
if (mode == 0 && opts->user_correct_pts != 0)
if (mode == 0 && opts->correct_pts)
mode = demuxer->stream->uncached_type == STREAMTYPE_DVD ? 2 : 1;
if (mode == 1)
avfc->flags |= AVFMT_FLAG_GENPTS;