# HG changeset patch # User reimar # Date 1186655160 0 # Node ID 4d576e0ed40b4487aff9dfa0eeb347fb36183308 # Parent 8434aae12d7cd72c75e95850fd53afadd9f15e4e 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. diff -r 8434aae12d7c -r 4d576e0ed40b libmpdemux/demuxer.c --- a/libmpdemux/demuxer.c Wed Aug 08 23:33:34 2007 +0000 +++ b/libmpdemux/demuxer.c Thu Aug 09 10:26:00 2007 +0000 @@ -209,6 +209,8 @@ 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 @@ 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]; }