diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-16 10:41:16 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-16 10:49:23 +0200 |
commit | b82f82fe0830e55c1c3393449fa0cc9160d82105 (patch) | |
tree | eb0d2601eaa31e6f035760dc80b4963bb6053cf3 | |
parent | 9c1bafb93a8621bbf3b76687ec61bd7cf5f16263 (diff) | |
download | mpv-b82f82fe0830e55c1c3393449fa0cc9160d82105.tar.bz2 mpv-b82f82fe0830e55c1c3393449fa0cc9160d82105.tar.xz |
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...
-rw-r--r-- | libmpdemux/demuxer.c | 8 |
1 files 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) |