changeset 27091:66e998895707

Add verbose messages about trying and searching for audio output drivers. Add messages showing why a specified audio output driver failed to be used. Based on a patch from Bryan Henderson, giraffedata [[]] gmail :: com
author corey
date Sun, 22 Jun 2008 19:25:54 +0000
parents c87a434526a9
children 0b4d8e4d4ed7
files help/help_mp-en.h libao2/audio_out.c
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Sun Jun 22 16:41:26 2008 +0000
+++ b/help/help_mp-en.h	Sun Jun 22 19:25:54 2008 +0000
@@ -1153,6 +1153,10 @@
 
 // audio_out.c
 #define MSGTR_AO_ALSA9_1x_Removed "audio_out: alsa9 and alsa1x modules were removed, use -ao alsa instead.\n"
+#define MSGTR_AO_TryingPreferredAudioDriver "Trying preferred audio driver '%.*s', options '%s'\n"
+#define MSGTR_AO_NoSuchDriver "No such audio driver '%.*s'\n"
+#define MSGTR_AO_FailedInit "Failed to initialize audio driver '%s'\n"
+#define MSGTR_AO_TryingEveryKnown "Trying every known audio driver...\n"
 
 // ao_oss.c
 #define MSGTR_AO_OSS_CantOpenMixer "[AO OSS] audio_setup: Can't open mixer device %s: %s\n"
--- a/libao2/audio_out.c	Sun Jun 22 16:41:26 2008 +0000
+++ b/libao2/audio_out.c	Sun Jun 22 19:25:54 2008 +0000
@@ -134,14 +134,23 @@
         }
         else
             ao_len = strlen(ao);
+
+        mp_msg(MSGT_AO, MSGL_V, MSGTR_AO_TryingPreferredAudioDriver,
+               ao_len, ao, ao_subdevice ? ao_subdevice : "[none]");
+
         for(i=0;audio_out_drivers[i];i++){
             const ao_functions_t* audio_out=audio_out_drivers[i];
             if(!strncmp(audio_out->info->short_name,ao,ao_len)){
                 // name matches, try it
                 if(audio_out->init(rate,channels,format,flags))
                     return audio_out; // success!
+                else
+                    mp_msg(MSGT_AO, MSGL_WARN, MSGTR_AO_FailedInit, ao);
+                break;
             }
         }
+	if (!audio_out_drivers[i]) // we searched through the entire list
+            mp_msg(MSGT_AO, MSGL_WARN, MSGTR_AO_NoSuchDriver, ao_len, ao);
         // continue...
         ++ao_list;
         if(!(ao_list[0])) return NULL; // do NOT fallback to others
@@ -150,6 +159,9 @@
         free(ao_subdevice);
         ao_subdevice = NULL;
     }
+
+    mp_msg(MSGT_AO, MSGL_V, MSGTR_AO_TryingEveryKnown);
+
     // now try the rest...
     for(i=0;audio_out_drivers[i];i++){
         const ao_functions_t* audio_out=audio_out_drivers[i];