# HG changeset patch # User henry # Date 1113254774 0 # Node ID 96512bcb2eca24e3a54e3ae3aa72efcd15ececdb # Parent c8abe722140e93e0be38822a22800e397469d967 allow sub_select and vobsub_lang to select particular subtitle diff -r c8abe722140e -r 96512bcb2eca DOCS/tech/slave.txt --- a/DOCS/tech/slave.txt Mon Apr 11 21:25:06 2005 +0000 +++ b/DOCS/tech/slave.txt Mon Apr 11 21:26:14 2005 +0000 @@ -101,10 +101,12 @@ 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 [] + Display subtitle with index . Turn subtitle display off if + is -1 or greater than the highest available subtitle index. + Cycle through the available subtitles if 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 -r c8abe722140e -r 96512bcb2eca input/input.c --- a/input/input.c Mon Apr 11 21:25:06 2005 +0000 +++ b/input/input.c Mon Apr 11 21:26:14 2005 +0000 @@ -77,8 +77,8 @@ { 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 -r c8abe722140e -r 96512bcb2eca mplayer.c --- a/mplayer.c Mon Apr 11 21:25:06 2005 +0000 +++ b/mplayer.c Mon Apr 11 21:26:14 2005 +0000 @@ -3375,8 +3375,12 @@ case MP_CMD_SUB_SELECT: if (global_sub_size) { int source = -1; - - global_sub_pos++; + int v = cmd->args[0].v.i; + + 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)