diff mpcommon.c @ 26269:65ad20416dd7

Support 'default' attribute for audio and subtitle tracks. The first default track is chosen for playback if language-based selection failes. Additionally, for audio tracks, the first one is chosen if there are no default tracks at all.
author eugeni
date Sun, 30 Mar 2008 16:55:46 +0000
parents c585e2ad8ebf
children 9d53b15aed02
line wrap: on
line diff
--- a/mpcommon.c	Sat Mar 29 15:51:05 2008 +0000
+++ b/mpcommon.c	Sun Mar 30 16:55:46 2008 +0000
@@ -195,6 +195,8 @@
 {
     if (audio_id == -1 && audio_lang)
         audio_id = demuxer_audio_track_by_lang(demuxer, audio_lang);
+    if (audio_id == -1)
+        audio_id = demuxer_default_audio_track(demuxer);
     if (audio_id != -1) // -1 (automatic) is the default behaviour of demuxers
         demuxer_switch_audio(demuxer, audio_id);
     if (audio_id == -2) { // some demuxers don't yet know how to switch to no sound