[MPlayer-cvslog] r32680 - in trunk: DOCS/man/en/mplayer.1 DOCS/tech/slave.txt command.c input/input.c

reimar subversion at mplayerhq.hu
Sat Dec 11 13:44:39 CET 2010


Author: reimar
Date: Sat Dec 11 13:44:39 2010
New Revision: 32680

Log:
Allow cycling subtitles backwards with 'J'.

Modified:
   trunk/DOCS/tech/slave.txt
   trunk/command.c
   trunk/input/input.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt	Sat Dec 11 13:23:07 2010	(r32679)
+++ trunk/DOCS/tech/slave.txt	Sat Dec 11 13:44:39 2010	(r32680)
@@ -342,7 +342,8 @@ sub_select [value]
     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 [source]
     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 <value> [abs]
     Adjust the subtitle size by +/- <value> or set it to <value> when [abs]

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	Sat Dec 11 13:23:07 2010	(r32679)
+++ trunk/command.c	Sat Dec 11 13:44:39 2010	(r32680)
@@ -2302,8 +2302,8 @@ void property_print_help(void)
  *
  * 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 @@ static int set_property_command(MPContex
         // 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

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	Sat Dec 11 13:23:07 2010	(r32679)
+++ trunk/input/input.c	Sat Dec 11 13:44:39 2010	(r32680)
@@ -427,6 +427,7 @@ static const mp_cmd_bind_t def_cmd_binds
   { { '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" },


More information about the MPlayer-cvslog mailing list