# HG changeset patch # User reimar # Date 1184865289 0 # Node ID f4f7dd84188bbffebb7c835fdf78a2f1c297699e # Parent 0a38ad149c5c74181c598bc783c3572bc92eddbb Make sure all demuxer subtitles can be selected with 'j', even if this leaves "holes" (allows to select subtitles that do not exist). Fixes subtitle switching with http://samples.mplayerhq.hu/sub/NeroMP4/unsupported-embedded-subs-2.mp4 diff -r 0a38ad149c5c -r f4f7dd84188b mplayer.c --- a/mplayer.c Thu Jul 19 13:52:39 2007 +0000 +++ b/mplayer.c Thu Jul 19 17:14:49 2007 +0000 @@ -3011,11 +3011,13 @@ if (mpctx->stream->type != STREAMTYPE_DVD && mpctx->stream->type != STREAMTYPE_DVDNAV) { int i; + int maxid = -1; // setup global sub numbering mpctx->global_sub_indices[SUB_SOURCE_DEMUX] = mpctx->global_sub_size; // the global # of the first demux-specific sub. for (i = 0; i < MAX_S_STREAMS; i++) if (mpctx->demuxer->s_streams[i]) - mpctx->global_sub_size++; + 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;