summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
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;