summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-11 21:26:14 +0000
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-11 21:26:14 +0000
commite956780cc0eb3888a8b70de3c03af76f7b3921b8 (patch)
treeb1f911e0db4e52b2fd560fbc0c15510ee308bf56
parent16d2d5ca820f3536f0180981728e4e52bc9e0bbc (diff)
downloadmpv-e956780cc0eb3888a8b70de3c03af76f7b3921b8.tar.bz2
mpv-e956780cc0eb3888a8b70de3c03af76f7b3921b8.tar.xz
allow sub_select and vobsub_lang to select particular subtitle
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15129 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--DOCS/tech/slave.txt10
-rw-r--r--input/input.c4
-rw-r--r--mplayer.c6
3 files changed, 13 insertions, 7 deletions
diff --git a/DOCS/tech/slave.txt b/DOCS/tech/slave.txt
index 940b5d279c..59b5374379 100644
--- a/DOCS/tech/slave.txt
+++ b/DOCS/tech/slave.txt
@@ -101,10 +101,12 @@ sub_visibility
get_sub_visibility
Print out subtitle visibility (1 == on, 0 == off).
-sub_select
- Cycle through the available subtitles. Supported subtitle sources are
- -sub options on the command line, VOBsubs, DVD subtitles, and Ogg text
- streams.
+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
+ line, VOBsubs, DVD subtitles, and Ogg and Matroska text streams.
sub_log
Logs the current or last displayed subtitle together with filename
diff --git a/input/input.c b/input/input.c
index a1470f1bd1..402c11b8a3 100644
--- a/input/input.c
+++ b/input/input.c
@@ -77,8 +77,8 @@ static mp_cmd_t mp_cmds[] = {
{ MP_CMD_SUB_POS, "sub_pos", 1, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_SUB_ALIGNMENT, "sub_alignment",0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
{ MP_CMD_SUB_VISIBILITY, "sub_visibility", 0, { {-1,{0}} } },
- { MP_CMD_SUB_SELECT, "vobsub_lang", 0, { {-1,{0}} } }, // for compatibility
- { MP_CMD_SUB_SELECT, "sub_select", 0, { {-1,{0}} } },
+ { MP_CMD_SUB_SELECT, "vobsub_lang", 0, { { MP_CMD_ARG_INT,{-2} }, {-1,{0}} } }, // for compatibility
+ { MP_CMD_SUB_SELECT, "sub_select", 0, { { MP_CMD_ARG_INT,{-2} }, {-1,{0}} } },
{ MP_CMD_SUB_LOG, "sub_log", 0, { {-1,{0}} } },
{ MP_CMD_GET_PERCENT_POS, "get_percent_pos", 0, { {-1,{0}} } },
{ MP_CMD_GET_TIME_LENGTH, "get_time_length", 0, { {-1,{0}} } },
diff --git a/mplayer.c b/mplayer.c
index 41813e5af5..24d6c571fd 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3375,8 +3375,12 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
case MP_CMD_SUB_SELECT:
if (global_sub_size) {
int source = -1;
+ int v = cmd->args[0].v.i;
- global_sub_pos++;
+ if (v < -1)
+ global_sub_pos++;
+ else
+ global_sub_pos = v;
if (global_sub_pos >= global_sub_size)
global_sub_pos = -1;
if (global_sub_pos >= 0)