demux: improve -alang / -slang track choosing logic
commit3c2cfee488f09bd34b1edf80219d9ea66508c669
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Mon, 8 Nov 2010 11:05:49 +0000 (8 13:05 +0200)
committerUoti Urpala <uau@glyph.nonexistent.invalid>
Mon, 8 Nov 2010 16:05:12 +0000 (8 18:05 +0200)
treea8048a070e741a922a283ee8283cc2e87b6ee32e
parentfc66c94360b7326faa022d26fb7668437b4da0b1
demux: improve -alang / -slang track choosing logic

When -alang / -slang was specified the numerically first matching
track (if any) was always chosen. This meant that specifying "-alang
eng" could change the track choice even if all tracks were in English,
because now the default flag of tracks was ignored. Change the logic
to take the default flag into account as a secondary sorting key.

The code also accepted prefix matches, so that "-slang g" would match
track language "ger". I think that was not intentional. Change it to
require exact matches.
libmpdemux/demuxer.c
libmpdemux/demuxer.h
mpcommon.c
mplayer.c