1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-03 12:47:49 +00:00

When a new subtitle stream becomes available check if it is the one that

was requested by the user and set up sub->id and sub->sh accordingly.
Fixes -slang and -sid with DVD subtitles (basically only 'j' during playback
could make them show). This was broken by r23786.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24042 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-08-09 10:26:00 +00:00
parent f0322c3866
commit 185bc3320f

View File

@ -209,6 +209,8 @@ demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id,char
return d;
}
extern int dvdsub_id;
sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid) {
if (id > MAX_S_STREAMS - 1 || id < 0) {
mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested sub stream id overflow (%d > %d)\n",
@ -222,6 +224,10 @@ sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid) {
demuxer->s_streams[id] = sh;
sh->sid = sid;
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", sid);
if (dvdsub_id == id) {
demuxer->sub->id = id;
demuxer->sub->sh = sh;
}
}
return demuxer->s_streams[id];
}