From b82f82fe0830e55c1c3393449fa0cc9160d82105 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 16 Nov 2010 10:41:16 +0200 Subject: [PATCH] demux: fix initial subtitle track selection Commit 3c2cfee488 ("demux: improve -alang / -slang track choosing logic") had a copy/paste error which left the subtitle code using audio variables and broke initial subtitle track selection. Fix. I actually realized soon after creating the original commit that I'd forgotten to change the variables and went back to fix it, but then somehow thought that it was already OK and didn't change it... --- libmpdemux/demuxer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index fe4dc18d23..51343f1595 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -1604,14 +1604,14 @@ int demuxer_sub_track_by_lang_and_default(struct demuxer *d, char *lang) lang += strspn(lang, ","); int len = strcspn(lang, ","); int id = -1; - for (int i = 0; i < MAX_A_STREAMS; i++) { - struct sh_audio *sh = d->a_streams[i]; + for (int i = 0; i < MAX_S_STREAMS; i++) { + struct sh_sub *sh = d->s_streams[i]; if (sh && (!len || sh->lang && strlen(sh->lang) == len && !memcmp(lang, sh->lang, len))) { if (sh->default_track) - return sh->aid; + return sh->sid; if (id < 0) - id = sh->aid; + id = sh->sid; } } if (!len)