Re: [MPlayer-dev-eng] [PATCH] add messages about search for audio driver
- Date: Tue, 17 Jun 2008 23:48:36 -0700
- From: Corey Hickey <bugfood-ml@xxxxxxxxxx>
- Subject: Re: [MPlayer-dev-eng] [PATCH] add messages about search for audio driver
Bryan Henderson wrote:
> I thought this had been committed, but I don't see it, so here it is again.
Is this modified version acceptable with respect to what you intended?
Please test it.
Changes:
* use %.*s instead of %*.*s
* separate messages for "no driver" and "can't initialize"
* a little logic to make the separate messages possible
* MSGL_WARN for the problem messages
* some slight wording changes
-Corey
Index: libao2/audio_out.c
===================================================================
--- libao2/audio_out.c (revision 27097)
+++ libao2/audio_out.c (working copy)
@@ -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];
Index: help/help_mp-en.h
===================================================================
--- help/help_mp-en.h (revision 27097)
+++ help/help_mp-en.h (working copy)
@@ -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"
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng