From 96daf7ed5ef96b86f2539164c27155bc830aa2a6 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Wed, 8 Apr 2009 02:37:27 +0300 Subject: [PATCH] Add option -noordered-chapters. --- DOCS/man/en/mplayer.1 | 5 +++++ cfg-mplayer.h | 3 +++ defaultopts.c | 1 + mplayer.c | 6 ++++++ options.h | 1 + 5 files changed, 16 insertions(+) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 39ca6543d6..355055c721 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -1071,6 +1071,11 @@ Turns off LIRC support. .B \-nomouseinput Disable mouse button press/\:release input (mozplayerxp's context menu relies on this option). +.TP +.B \-noorderedchapters +Disable support for Matroska ordered chapters. +MPlayer will not load or search for video segments from other files, +and will also ignore any chapter order specified for the main file. . .TP .B \-rtc (RTC only) diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 5b5a1ac176..7b2335d776 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -311,6 +311,9 @@ const m_option_t mplayer_opts[]={ OPT_INTRANGE("loop", loop_times, 0, -1, 10000), {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL}, + OPT_FLAG_ON("ordered-chapters", ordered_chapters, 0), + OPT_FLAG_OFF("noordered-chapters", ordered_chapters, 0), + // a-v sync stuff: OPT_FLAG_ON("correct-pts", user_correct_pts, 0), OPT_FLAG_OFF("nocorrect-pts", user_correct_pts, 0), diff --git a/defaultopts.c b/defaultopts.c index b35601e917..dfd163e865 100644 --- a/defaultopts.c +++ b/defaultopts.c @@ -20,6 +20,7 @@ void set_default_mplayer_options(struct MPOpts *opts) .osd_level = 1, .osd_duration = 1000, .loop_times = -1, + .ordered_chapters = 1, .user_correct_pts = -1, .key_fifo_size = 7, .doubleclick_time = 300, diff --git a/mplayer.c b/mplayer.c index bd5957cee0..8bcaa3430b 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2730,6 +2730,12 @@ static int find_ordered_chapter_sources(struct MPContext *mpctx, static void build_ordered_chapter_timeline(struct MPContext *mpctx) { + if (!mpctx->opts.ordered_chapters) { + mp_msg(MSGT_CPLAYER, MSGL_INFO, "File uses ordered chapters, but " + "you have disabled support for them. Ignoring.\n"); + return; + } + mp_msg(MSGT_CPLAYER, MSGL_INFO, "File uses ordered chapters, will build " "edit timeline.\n"); diff --git a/options.h b/options.h index 33dcccd883..a7411f83bc 100644 --- a/options.h +++ b/options.h @@ -28,6 +28,7 @@ typedef struct MPOpts { int osd_level; int osd_duration; int loop_times; + int ordered_chapters; int correct_pts; int user_correct_pts; int key_fifo_size; -- 2.11.4.GIT