# HG changeset patch # User reimar # Date 1292071479 0 # Node ID 0c5bb45690ead96bce05d1496a66ade9f7a51ebf # Parent 9ec31cdc76ad08778cdc2fafa3b53268883a0e28 Allow cycling subtitles backwards with 'J'. diff -r 9ec31cdc76ad -r 0c5bb45690ea DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Sat Dec 11 12:23:07 2010 +0000 +++ b/DOCS/man/en/mplayer.1 Sat Dec 11 12:44:39 2010 +0000 @@ -271,7 +271,7 @@ (see \-framedrop and \-hardframedrop). .IPs "v\ \ \ \ " Toggle subtitle visibility. -.IPs "j\ \ \ \ " +.IPs "j and J" Cycle through the available subtitles. .IPs "y and g" Step forward/backward in the subtitle list. diff -r 9ec31cdc76ad -r 0c5bb45690ea DOCS/tech/slave.txt --- a/DOCS/tech/slave.txt Sat Dec 11 12:23:07 2010 +0000 +++ b/DOCS/tech/slave.txt Sat Dec 11 12:44:39 2010 +0000 @@ -342,7 +342,8 @@ Display subtitle with index [value]. Turn subtitle display off if [value] is -1 or greater than the highest available subtitle index. Cycle through the available subtitles if [value] is omitted or less - than -1. Supported subtitle sources are -sub options on the command + than -1 ((forward or backward respectively). + Supported subtitle sources are -sub options on the command line, VOBsubs, DVD subtitles, and Ogg and Matroska text streams. This command is mainly for cycling all subtitles, if you want to set a specific subtitle, use sub_file, sub_vob, or sub_demux. @@ -352,26 +353,30 @@ SUB_SOURCE_SUBS (0) for file subs SUB_SOURCE_VOBSUB (1) for VOBsub files SUB_SOURCE_DEMUX (2) for subtitle embedded in the media file or DVD subs. - If [source] is -1, will turn off subtitle display. If [source] less than -1, - will cycle between the first subtitle of each currently available sources. + If [source] is -1, will turn off subtitle display. + If [value] is omitted or less than -1, will cycle between the first subtitle + of each currently available source (forward or backward respectively). sub_file [value] Display subtitle specifid by [value] for file subs. The [value] is corresponding to ID_FILE_SUB_ID values reported by '-identify'. - If [value] is -1, will turn off subtitle display. If [value] less than -1, - will cycle all file subs. + If [value] is -1, will turn off subtitle display. + If [value] is omitted or less than -1, will cycle all file subs + (forward or backward respectively). sub_vob [value] Display subtitle specifid by [value] for vobsubs. The [value] is corresponding to ID_VOBSUB_ID values reported by '-identify'. - If [value] is -1, will turn off subtitle display. If [value] less than -1, - will cycle all vobsubs. + If [value] is -1, will turn off subtitle display. + If [value] is omitted or less than -1, will cycle all vobsubs + (forward or backward respectively). sub_demux [value] Display subtitle specifid by [value] for subtitles from DVD or embedded in media file. The [value] is corresponding to ID_SUBTITLE_ID values reported by '-identify'. If [value] is -1, will turn off subtitle display. - If [value] less than -1, will cycle all DVD subs or embedded subs. + If [value] is omitted or less than -1, will cycle all DVD subs or embedded subs + (forward or backward respectively). sub_scale [abs] Adjust the subtitle size by +/- or set it to when [abs] diff -r 9ec31cdc76ad -r 0c5bb45690ea command.c --- a/command.c Sat Dec 11 12:23:07 2010 +0000 +++ b/command.c Sat Dec 11 12:44:39 2010 +0000 @@ -2302,8 +2302,8 @@ * * Toggle commands take 0 or 1 parameters. With no parameter * or a value less than the property minimum it just steps the - * property to its next value. Otherwise it sets it to the given - * value. + * property to its next or previous value respectively. + * Otherwise it sets it to the given value. * *@{ */ @@ -2396,6 +2396,8 @@ // set to value if (cmd->nargs > 0 && cmd->args[0].v.i >= prop->min) r = mp_property_do(pname, M_PROPERTY_SET, &cmd->args[0].v.i, mpctx); + else if (cmd->nargs > 0) + r = mp_property_do(pname, M_PROPERTY_STEP_DOWN, NULL, mpctx); else r = mp_property_do(pname, M_PROPERTY_STEP_UP, NULL, mpctx); } else if (cmd->args[1].v.i) //set diff -r 9ec31cdc76ad -r 0c5bb45690ea input/input.c --- a/input/input.c Sat Dec 11 12:23:07 2010 +0000 +++ b/input/input.c Sat Dec 11 12:44:39 2010 +0000 @@ -427,6 +427,7 @@ { { 'a', 0 }, "sub_alignment" }, { { 'v', 0 }, "sub_visibility" }, { { 'j', 0 }, "sub_select" }, + { { 'J', 0 }, "sub_select -3" }, { { 'F', 0 }, "forced_subs_only" }, { { '#', 0 }, "switch_audio" }, { { '_', 0 }, "step_property switch_video" },