[MPlayer-cvslog] r34777 - trunk/libmpdemux/demuxer.c
reimar
subversion at mplayerhq.hu
Sat Feb 25 19:26:31 CET 2012
Author: reimar
Date: Sat Feb 25 19:26:31 2012
New Revision: 34777
Log:
Fix DVDs showing the subtitle language as "unknown"
for a long time.
Modified:
trunk/libmpdemux/demuxer.c
Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c Sat Feb 25 00:34:55 2012 (r34776)
+++ trunk/libmpdemux/demuxer.c Sat Feb 25 19:26:31 2012 (r34777)
@@ -1815,14 +1815,14 @@ int demuxer_sub_lang(demuxer_t *d, int i
if (id < 0 || id >= MAX_S_STREAMS)
return -1;
sh = d->s_streams[id];
- if (!sh)
- return -1;
- if (sh->lang) {
+ if (sh && sh->lang) {
av_strlcpy(buf, sh->lang, buf_len);
return 0;
}
req.type = stream_ctrl_sub;
- req.id = sh->sid;
+ // assume 1:1 mapping so we can show the language of
+ // DVD subs even when we have not yet created the stream.
+ req.id = sh ? sh->sid : id;
if (stream_control(d->stream, STREAM_CTRL_GET_LANG, &req) == STREAM_OK) {
av_strlcpy(buf, req.buf, buf_len);
return 0;
More information about the MPlayer-cvslog
mailing list