summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-19 17:14:49 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-19 17:14:49 +0000
commitd7f314b0a969afbda357f978396f7fc476875201 (patch)
tree2e9fd05ff8acfe98f371a2d86b0b9bd5d710d39a /mplayer.c
parente607c7289f5fa7487f810eff2f1e71970cf0645b (diff)
downloadmpv-d7f314b0a969afbda357f978396f7fc476875201.tar.bz2
mpv-d7f314b0a969afbda357f978396f7fc476875201.tar.xz
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 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23827 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mplayer.c b/mplayer.c
index df6c44fe34..113946d388 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3011,11 +3011,13 @@ inited_flags|=INITED_DEMUXER;
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;