mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
e607c7289f
commit
d7f314b0a9
|
@ -3011,11 +3011,13 @@ inited_flags|=INITED_DEMUXER;
|
||||||
|
|
||||||
if (mpctx->stream->type != STREAMTYPE_DVD && mpctx->stream->type != STREAMTYPE_DVDNAV) {
|
if (mpctx->stream->type != STREAMTYPE_DVD && mpctx->stream->type != STREAMTYPE_DVDNAV) {
|
||||||
int i;
|
int i;
|
||||||
|
int maxid = -1;
|
||||||
// setup global sub numbering
|
// setup global sub numbering
|
||||||
mpctx->global_sub_indices[SUB_SOURCE_DEMUX] = mpctx->global_sub_size; // the global # of the first demux-specific sub.
|
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++)
|
for (i = 0; i < MAX_S_STREAMS; i++)
|
||||||
if (mpctx->demuxer->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;
|
if (mpctx->global_sub_size <= dvdsub_id) mpctx->global_sub_size = dvdsub_id + 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue