changeset 24934:919e3927809b

Old code for dvdsub_id fix assume the global_sub_indices[SUB_SOURCE_DEMUX] must be zero when use a dvdsub_id greater than max sub id from demux. To remove the implicit assumption, make it up here.
author ulion
date Sun, 04 Nov 2007 05:23:46 +0000
parents 4fc6e60dac36
children 36fef61bbfa4
files mplayer.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sat Nov 03 22:25:52 2007 +0000
+++ b/mplayer.c	Sun Nov 04 05:23:46 2007 +0000
@@ -3019,7 +3019,9 @@
       maxid = FFMAX(maxid, ((sh_sub_t *)mpctx->demuxer->s_streams[i])->sid);
   mpctx->global_sub_size += maxid + 1;
 }
-if (mpctx->global_sub_size <= dvdsub_id) mpctx->global_sub_size = dvdsub_id + 1;
+// Make dvdsub_id always selectable if set.
+if (mpctx->global_sub_size <= mpctx->global_sub_indices[SUB_SOURCE_DEMUX] + dvdsub_id)
+  mpctx->global_sub_size = mpctx->global_sub_indices[SUB_SOURCE_DEMUX] + dvdsub_id + 1;
 
 current_module="demux_open2";