changeset 13383:c1955840883d

mp_msg transition of unmaintained audio output drivers. Patch by Reynaldo H. Verdejo Pinochet <reynaldo at opendot dot cl>
author ivo
date Sat, 18 Sep 2004 20:31:28 +0000
parents e20fbb99d7f9
children 8b2c2eb9a891
files AUTHORS help/help_mp-en.h libao2/ao_alsa5.c libao2/ao_arts.c libao2/ao_dxr2.c libao2/ao_esd.c libao2/ao_mpegpes.c libao2/ao_null.c libao2/ao_oss.c libao2/ao_pcm.c libao2/ao_sdl.c libao2/ao_sgi.c libao2/ao_sun.c
diffstat 13 files changed, 191 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Sat Sep 18 18:14:25 2004 +0000
+++ b/AUTHORS	Sat Sep 18 20:31:28 2004 +0000
@@ -671,6 +671,7 @@
 
 Verdejo Pinochet, Reynaldo H. (reynaldo) <reynaldo@opendot.cl>
     * improved EDL support
+    * mp_msg transition on unmantained libao2 drivers
 
 Wigren, Per <wigren@home.se>
     * bmovl - Bitmap Overlay video filter
--- a/help/help_mp-en.h	Sat Sep 18 18:14:25 2004 +0000
+++ b/help/help_mp-en.h	Sat Sep 18 20:31:28 2004 +0000
@@ -781,3 +781,101 @@
 #define MSGTR_VO_JPEG_BaselineJPEG "Baseline JPEG enabled."
 #define MSGTR_VO_JPEG_NoBaselineJPEG "Baseline JPEG disabled."
 
+// ======================= AO Audio Output drivers ========================
+
+// libao2 
+
+// ao_oss.c
+#define MSGTR_AO_OSS_CantOpenMixer "[AO OSS] audio_setup: Can't open mixer device %s: %s\n"
+#define MSGTR_AO_OSS_ChanNotFound "[AO OSS] audio_setup: Audio card mixer does not have channel '%s' using default.\n"
+#define MSGTR_AO_OSS_CantOpenDev "[AO OSS] audio_setup: Can't open audio device %s: %s\n"
+#define MSGTR_AO_OSS_CantMakeFd "[AO OSS] audio_setup: Can't make filedescriptor blocking: %s\n"
+#define MSGTR_AO_OSS_CantSetAC3 "[AO OSS] Can't set audio device %s to AC3 output, trying S16...\n"
+#define MSGTR_AO_OSS_CantSetChans "[AO OSS] audio_setup: Failed to set audio device to %d channels.\n"
+#define MSGTR_AO_OSS_CantUseGetospace "[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(\n"
+#define MSGTR_AO_OSS_CantUseSelect "[AO OSS]\n   ***  Your audio driver DOES NOT support select()  ***\n Recompile mplayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n"
+#define MSGTR_AO_OSS_CantReopen "[AO OSS]\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n"
+
+// ao_arts.c
+#define MSGTR_AO_ARTS_CantInit "[AO ARTS] %s\n"
+#define MSGTR_AO_ARTS_ServerConnect "[AO ARTS] Connected to sound server.\n"
+#define MSGTR_AO_ARTS_CantOpenStream "[AO ARTS] Unable to open a stream.\n"
+#define MSGTR_AO_ARTS_StreamOpen "[AO ARTS] Stream opened.\n"
+#define MSGTR_AO_ARTS_BufferSize "[AO ARTS] buffer size: %d\n"
+
+// ao_dxr2.c
+#define MSGTR_AO_DXR2_SetVolFailed "[AO DXR2] Setting volume to %d failed.\n"
+#define MSGTR_AO_DXR2_UnsupSamplerate "[AO DXR2] dxr2: %d Hz not supported, try \"-aop list=resample\"\n"
+
+// ao_esd.c
+#define MSGTR_AO_ESD_CantOpenSound "[AO ESD] esd_open_sound failed: %s\n"
+#define MSGTR_AO_ESD_LatencyInfo "[AO ESD] latency: [server: %0.2fs, net: %0.2fs] (adjust %0.2fs)\n"
+#define MSGTR_AO_ESD_CantOpenPBStream "[AO ESD] failed to open esd playback stream: %s\n"
+
+// ao_mpegpes.c
+#define MSGTR_AO_MPEGPES_CantSetMixer "[AO MPEGPES] DVB audio set mixer failed: %s\n" 
+#define MSGTR_AO_MPEGPES_UnsupSamplerate "[AO MPEGPES] %d Hz not supported, try to resample...\n"
+
+// ao_null.c
+// This one desn't even  have any mp_msg nor printf's?? [CHECK]
+
+// ao_pcm.c
+#define MSGTR_AO_PCM_FileInfo "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n"
+#define MSGTR_AO_PCM_HintInfo "[AO PCM] Info: fastest dumping is achieved with -vc dummy -vo null\nPCM: Info: to write WAVE files use -waveheader (default)."
+#define MSGTR_AO_PCM_CantOpenOutputFile "[AO PCM] Failed to open %s for writing!\n"
+
+// ao_sdl.c
+#define MSGTR_AO_SDL_INFO "[AO SDL] Samplerate: %iHz Channels: %s Format %s\n"
+#define MSGTR_AO_SDL_DriverInfo "[AO SDL] using %s audio driver.\n"
+#define MSGTR_AO_SDL_UnsupportedAudioFmt "[AO SDL] Unsupported audio format: 0x%x.\n"
+#define MSGTR_AO_SDL_CantInit "[AO SDL] Initializing of SDL Audio failed: %s\n"
+#define MSGTR_AO_SDL_CantOpenAudio "[AO SDL] Unable to open audio: %s\n"
+
+// ao_sgi.c
+#define MSGTR_AO_SGI_INFO "[AO SGI] control.\n"
+#define MSGTR_AO_SGI_InitInfo "[AO SGI] init: Samplerate: %iHz Channels: %s Format %s\n"
+#define MSGTR_AO_SGI_InvalidDevice "[AO SGI] play: invalid device.\n"
+#define MSGTR_AO_SGI_CantSetParms_Samplerate "[AO SGI] init: setparams failed: %s\nCould not set desired samplerate.\n"
+#define MSGTR_AO_SGI_CantSetAlRate "[AO SGI] init: AL_RATE was not accepted on the given resource.\n"
+#define MSGTR_AO_SGI_CantGetParms "[AO SGI] init: getparams failed: %s\n"
+#define MSGTR_AO_SGI_SampleRateInfo "[AO SGI] init: samplerate is now %lf (desired rate is %lf)\n"
+#define MSGTR_AO_SGI_InitConfigError "[AO SGI] init: %s\n"
+#define MSGTR_AO_SGI_InitOpenAudioFailed "[AO SGI] init: Unable to open audio channel: %s\n"
+#define MSGTR_AO_SGI_Uninit "[AO SGI] uninit: ...\n"
+#define MSGTR_AO_SGI_Reset "[AO SGI] reset: ...\n"
+#define MSGTR_AO_SGI_PauseInfo "[AO SGI] audio_pause: ...\n"
+#define MSGTR_AO_SGI_ResumeInfo "[AO SGI] audio_resume: ...\n"
+
+// ao_sun.c
+#define MSGTR_AO_SUN_RtscSetinfoFailed "[AO SUN] rtsc: SETINFO failed.\n"
+#define MSGTR_AO_SUN_RtscWriteFailed "[AO SUN] rtsc: write failed."
+#define MSGTR_AO_SUN_CantOpenAudioDev "[AO SUN] Can't open audio device %s, %s  -> nosound.\n"
+#define MSGTR_AO_SUN_UnsupSampleRate "[AO SUN] audio_setup: your card doesn't support %d channel, %s, %d Hz samplerate.\n"
+#define MSGTR_AO_SUN_CantUseSelect "[AO SUN]\n   ***  Your audio driver DOES NOT support select()  ***\nRecompile mplayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n"
+#define MSGTR_AO_SUN_CantReopenReset "[AO SUN]\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE (%s) ***\n"
+
+// ao_alsa5.c
+#define MSGTR_AO_ALSA5_InitInfo "[AO ALSA5] alsa-init: requested format: %d Hz, %d channels, %s\n"
+#define MSGTR_AO_ALSA5_SoundCardNotFound "[AO ALSA5] alsa-init: no soundcards found.\n"
+#define MSGTR_AO_ALSA5_InvalidFormatReq "[AO ALSA5] alsa-init: invalid format (%s) requested - output disabled.\n"
+#define MSGTR_AO_ALSA5_PlayBackError "[AO ALSA5] alsa-init: playback open error: %s\n"
+#define MSGTR_AO_ALSA5_PcmInfoError "[AO ALSA5] alsa-init: pcm info error: %s\n"
+#define MSGTR_AO_ALSA5_SoundcardsFound "[AO ALSA5] alsa-init: %d soundcard(s) found, using: %s\n"
+#define MSGTR_AO_ALSA5_PcmChanInfoError "[AO ALSA5] alsa-init: pcm channel info error: %s\n"
+#define MSGTR_AO_ALSA5_CantSetParms "[AO ALSA5] alsa-init: error setting parameters: %s\n"
+#define MSGTR_AO_ALSA5_CantSetChan "[AO ALSA5] alsa-init: error setting up channel: %s\n"
+#define MSGTR_AO_ALSA5_ChanPrepareError "[AO ALSA5] alsa-init: channel prepare error: %s\n"
+#define MSGTR_AO_ALSA5_DrainError "[AO ALSA5] alsa-uninit: playback drain error: %s\n"
+#define MSGTR_AO_ALSA5_FlushError "[AO ALSA5] alsa-uninit: playback flush error: %s\n"
+#define MSGTR_AO_ALSA5_PcmCloseError "[AO ALSA5] alsa-uninit: pcm close error: %s\n"
+#define MSGTR_AO_ALSA5_ResetDrainError "[AO ALSA5] alsa-reset: playback drain error: %s\n"
+#define MSGTR_AO_ALSA5_ResetFlushError "[AO ALSA5] alsa-reset: playback flush error: %s\n"
+#define MSGTR_AO_ALSA5_ResetChanPrepareError "[AO ALSA5] alsa-reset: channel prepare error: %s\n"
+#define MSGTR_AO_ALSA5_PauseDrainError "[AO ALSA5] alsa-pause: playback drain error: %s\n"
+#define MSGTR_AO_ALSA5_PauseFlushError "[AO ALSA5] alsa-pause: playback flush error: %s\n"
+#define MSGTR_AO_ALSA5_ResumePrepareError "[AO ALSA5] alsa-resume: channel prepare error: %s\n"
+#define MSGTR_AO_ALSA5_Underrun "[AO ALSA5] alsa-play: alsa underrun, resetting stream.\n"
+#define MSGTR_AO_ALSA5_PlaybackPrepareError "[AO ALSA5] alsa-play: playback prepare error: %s\n"
+#define MSGTR_AO_ALSA5_WriteErrorAfterReset "[AO ALSA5] alsa-play: write error after reset: %s - giving up.\n"
+#define MSGTR_AO_ALSA5_OutPutError "[AO ALSA5] alsa-play: output error: %s\n"
+
--- a/libao2/ao_alsa5.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_alsa5.c	Sat Sep 18 20:31:28 2004 +0000
@@ -16,6 +16,7 @@
 #include "afmt.h"
 
 #include "../mp_msg.h"
+#include "../help_mp.h"
 
 static ao_info_t info = 
 {
@@ -50,7 +51,7 @@
     snd_pcm_info_t info;
     snd_pcm_channel_info_t chninfo;
 
-    mp_msg(MSGT_AO, MSGL_INFO, "alsa-init: requested format: %d Hz, %d channels, %s\n", rate_hz,
+    mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ALSA5_InitInfo, rate_hz,
 	channels, audio_out_format_name(format));
 
     alsa_handler = NULL;
@@ -60,7 +61,7 @@
 
     if ((cards = snd_cards()) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: no soundcards found\n");
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_SoundCardNotFound);
 	return(0);
     }
 
@@ -110,7 +111,7 @@
 	    ao_data.bps *= 2;
 	    break;
 	case -1:
-	    mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: invalid format (%s) requested - output disabled\n",
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq,
 		audio_out_format_name(format));
 	    return(0);
 	default:
@@ -163,17 +164,17 @@
 
     if ((err = snd_pcm_open(&alsa_handler, 0, 0, SND_PCM_OPEN_PLAYBACK)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: playback open error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlayBackError, snd_strerror(err));
 	return(0);
     }
 
     if ((err = snd_pcm_info(alsa_handler, &info)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: pcm info error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmInfoError, snd_strerror(err));
 	return(0);
     }
 
-    mp_msg(MSGT_AO, MSGL_INFO, "alsa-init: %d soundcard(s) found, using: %s\n",
+    mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ALSA5_SoundcardsFound,
 	cards, info.name);
 
     if (info.flags & SND_PCM_INFO_PLAYBACK)
@@ -182,7 +183,7 @@
 	chninfo.channel = SND_PCM_CHANNEL_PLAYBACK;
 	if ((err = snd_pcm_channel_info(alsa_handler, &chninfo)) < 0)
 	{
-	    mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: pcm channel info error: %s\n", snd_strerror(err));
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmChanInfoError, snd_strerror(err));
 	    return(0);
 	}
 
@@ -206,7 +207,7 @@
 
     if ((err = snd_pcm_channel_params(alsa_handler, &params)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: error setting parameters: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetParms, snd_strerror(err));
 	return(0);
     }
 
@@ -219,13 +220,13 @@
     
     if ((err = snd_pcm_channel_setup(alsa_handler, &setup)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: error setting up channel: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetChan, snd_strerror(err));
 	return(0);
     }
 
     if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-init: channel prepare error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ChanPrepareError, snd_strerror(err));
 	return(0);
     }
 
@@ -242,19 +243,19 @@
 
     if ((err = snd_pcm_playback_drain(alsa_handler)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-uninit: playback drain error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_DrainError, snd_strerror(err));
 	return;
     }
 
     if ((err = snd_pcm_channel_flush(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-uninit: playback flush error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_FlushError, snd_strerror(err));
 	return;
     }
 
     if ((err = snd_pcm_close(alsa_handler)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-uninit: pcm close error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmCloseError, snd_strerror(err));
 	return;
     }
 }
@@ -266,19 +267,19 @@
 
     if ((err = snd_pcm_playback_drain(alsa_handler)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-reset: playback drain error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResetDrainError, snd_strerror(err));
 	return;
     }
 
     if ((err = snd_pcm_channel_flush(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-reset: playback flush error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResetFlushError, snd_strerror(err));
 	return;
     }
 
     if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-reset: channel prepare error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResetChanPrepareError, snd_strerror(err));
 	return;
     }
 }
@@ -290,13 +291,13 @@
 
     if ((err = snd_pcm_playback_drain(alsa_handler)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-pause: playback drain error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PauseDrainError, snd_strerror(err));
 	return;
     }
 
     if ((err = snd_pcm_channel_flush(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-pause: playback flush error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PauseFlushError, snd_strerror(err));
 	return;
     }
 }
@@ -307,7 +308,7 @@
     int err;
     if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
     {
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-resume: channel prepare error: %s\n", snd_strerror(err));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ResumePrepareError, snd_strerror(err));
 	return;
     }
 }
@@ -327,21 +328,21 @@
     {
 	if (got_len == -EPIPE) /* underrun? */
 	{
-	    mp_msg(MSGT_AO, MSGL_ERR, "alsa-play: alsa underrun, resetting stream\n");
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_Underrun);
 	    if ((got_len = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0)
 	    {
-		mp_msg(MSGT_AO, MSGL_ERR, "alsa-play: playback prepare error: %s\n", snd_strerror(got_len));
+		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlaybackPrepareError, snd_strerror(got_len));
 		return(0);
 	    }
 	    if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0)
 	    {
-		mp_msg(MSGT_AO, MSGL_ERR, "alsa-play: write error after reset: %s - giving up\n",
+		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_WriteErrorAfterReset,
 		    snd_strerror(got_len));
 		return(0);
 	    }
 	    return(got_len); /* 2nd write was ok */
 	}
-	mp_msg(MSGT_AO, MSGL_ERR, "alsa-play: output error: %s\n", snd_strerror(got_len));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_OutPutError, snd_strerror(got_len));
 	return(0);
     }
     return(got_len);
--- a/libao2/ao_arts.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_arts.c	Sat Sep 18 20:31:28 2004 +0000
@@ -15,6 +15,7 @@
 #include "afmt.h"
 #include "../config.h"
 #include "../mp_msg.h"
+#include "../help_mp.h"
 
 #define OBTAIN_BITRATE(a) (((a != AFMT_U8) && (a != AFMT_S8)) ? 16 : 8)
 
@@ -45,10 +46,10 @@
 	int frag_spec;
 
 	if( (err=arts_init()) ) {
-		mp_msg(MSGT_AO, MSGL_ERR, "AO: [arts] %s\n", arts_error_text(err));
+		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ARTS_CantInit, arts_error_text(err));
 		return 0;
 	}
-	mp_msg(MSGT_AO, MSGL_INFO, "AO: [arts] Connected to sound server\n");
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_ServerConnect);
 
 	/*
 	 * arts supports 8bit unsigned and 16bit signed sample formats
@@ -79,7 +80,7 @@
 	stream=arts_play_stream(rate_hz, OBTAIN_BITRATE(format), channels, "MPlayer");
 
 	if(stream == NULL) {
-		mp_msg(MSGT_AO, MSGL_ERR, "AO: [arts] Unable to open a stream\n");
+		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ARTS_CantOpenStream);
 		arts_free();
 		return 0;
 	}
@@ -90,11 +91,11 @@
 	frag_spec = ARTS_PACKET_SIZE_LOG2 | ARTS_PACKETS << 16;
 	arts_stream_set(stream, ARTS_P_PACKET_SETTINGS, frag_spec);
 	ao_data.buffersize = arts_stream_get(stream, ARTS_P_BUFFER_SIZE);
-	mp_msg(MSGT_AO, MSGL_INFO, "AO: [arts] Stream opened\n");
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_StreamOpen);
 
-	mp_msg(MSGT_AO, MSGL_INFO,"AO: [arts] buffer size: %d\n",
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_BufferSize,
 	    ao_data.buffersize);
-	mp_msg(MSGT_AO, MSGL_INFO,"AO: [arts] packet size: %d\n",
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ARTS_BufferSize,
 	    arts_stream_get(stream, ARTS_P_PACKET_SIZE));
 
 	return 1;
--- a/libao2/ao_dxr2.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_dxr2.c	Sat Sep 18 20:31:28 2004 +0000
@@ -50,7 +50,7 @@
       if(v.arg != volume) {
 	volume = v.arg;
 	if( ioctl(dxr2_fd,DXR2_IOC_SET_AUDIO_VOLUME,&v) < 0) {
-	  mp_msg(MSGT_AO,MSGL_ERR,"DXR2 : Setting volume to %d failed\n",volume);
+	  mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_DXR2_SetVolFailed,volume);
 	  return CONTROL_ERROR;
 	}
       }
@@ -110,7 +110,7 @@
 		break;
 #endif
 	default:
-		mp_msg(MSGT_AO,MSGL_ERR,"[AO] dxr2: %d Hz not supported, try \"-aop list=resample\"\n",rate);
+		mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_DXR2_UnsupSamplerate,rate);
 		return 0;
 	}
 
--- a/libao2/ao_esd.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_esd.c	Sat Sep 18 20:31:28 2004 +0000
@@ -37,6 +37,7 @@
 #include "afmt.h"
 #include "../config.h"
 #include "../mp_msg.h"
+#include "../help_mp.h"
 
 
 #undef	ESD_DEBUG
@@ -152,8 +153,7 @@
     if (esd_fd < 0) {
 	esd_fd = esd_open_sound(server);
 	if (esd_fd < 0) {
-	    mp_msg(MSGT_AO, MSGL_ERR, 
-		   "AO: [esd] esd_open_sound failed: %s\n",
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ESD_CantOpenSound,
 		   strerror(errno));
 	    return 0;
 	}
@@ -230,17 +230,14 @@
 	lag_serv = (esd_latency * 4.0f) / (bytes_per_sample * rate_hz);
 	lag_seconds = lag_net + lag_serv;
 	audio_delay += lag_seconds;
-	mp_msg(MSGT_AO, MSGL_INFO,
-	       "AO: [esd] latency: [server: %0.2fs, net: %0.2fs] "
-	       "(adjust %0.2fs)\n", lag_serv, lag_net, lag_seconds);
+	mp_msg(MSGT_AO, MSGL_INFO,MSGTR_AO_ESD_LatencyInfo, 
+	       lag_serv, lag_net, lag_seconds);
     }
     
     esd_play_fd = esd_play_stream_fallback(esd_fmt, rate_hz,
 					   server, ESD_CLIENT_NAME);
     if (esd_play_fd < 0) {
-	mp_msg(MSGT_AO, MSGL_ERR,
-	       "AO: [esd] failed to open esd playback stream: %s\n",
-	       strerror(errno));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ESD_CantOpenPBStream, strerror(errno));
 	return 0;
     }
 
--- a/libao2/ao_mpegpes.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_mpegpes.c	Sat Sep 18 20:31:28 2004 +0000
@@ -18,6 +18,7 @@
 #include "afmt.h"
 
 #include "../mp_msg.h"
+#include "../help_mp.h"
 
 #ifdef HAVE_DVB
 #ifndef HAVE_DVB_HEAD
@@ -67,7 +68,7 @@
 	    if(dvb_mixer.volume_right>255) dvb_mixer.volume_right=255;
 	    //	 printf("Setting DVB volume: %d ; %d  \n",dvb_mixer.volume_left,dvb_mixer.volume_right);
 	    if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MIXER, &dvb_mixer) < 0)){
-		mp_msg(MSGT_AO, MSGL_ERR, "DVB audio set mixer failed: %s\n",
+		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_MPEGPES_CantSetMixer,
 		    strerror(errno));
 	      return CONTROL_ERROR;
 	    }
@@ -112,7 +113,7 @@
 	case 44100:	freq_id=2;break;
 	case 32000:	freq_id=3;break;
 	default:
-	    mp_msg(MSGT_AO, MSGL_ERR, "ao_mpegpes: %d Hz not supported, try to resample...\n",rate);
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_MPEGPES_UnsupSamplerate, rate);
 #if 0
 	    if(rate>48000) rate=96000; else
 	    if(rate>44100) rate=48000; else
--- a/libao2/ao_null.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_null.c	Sat Sep 18 20:31:28 2004 +0000
@@ -110,9 +110,3 @@
     drain();
     return (float) buffer / (float) ao_data.bps;
 }
-
-
-
-
-
-
--- a/libao2/ao_oss.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_oss.c	Sat Sep 18 20:31:28 2004 +0000
@@ -14,6 +14,7 @@
 #include "../config.h"
 #include "../mp_msg.h"
 #include "../mixer.h"
+#include "../help_mp.h"
 
 #include "afmt.h"
 
@@ -108,7 +109,7 @@
     int fd, devs, i;
     
     if ((fd = open(oss_mixer_device, O_RDONLY)) == -1){
-      mp_msg(MSGT_AO,MSGL_ERR,"audio_setup: Can't open mixer device %s: %s\n",
+      mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantOpenMixer,
         oss_mixer_device, strerror(errno));
     }else{
       ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devs);
@@ -117,7 +118,7 @@
       for (i=0; i<SOUND_MIXER_NRDEVICES; i++){
         if(!strcasecmp(mixer_channels[i], mixer_channel)){
           if(!(devs & (1 << i))){
-            mp_msg(MSGT_AO,MSGL_ERR,"audio_setup: Audio card mixer does not have channel '%s' using default\n",
+            mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_ChanNotFound,
               mixer_channel);
             i = SOUND_MIXER_NRDEVICES+1;
             break;
@@ -127,7 +128,7 @@
         }
       }
       if(i==SOUND_MIXER_NRDEVICES){
-        mp_msg(MSGT_AO,MSGL_ERR,"audio_setup: Can't find mixer channel '%s' using default\n",
+        mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_ChanNotFound,
           mixer_channel);
       }
     }
@@ -143,14 +144,14 @@
   audio_fd=open(dsp, O_WRONLY);
 #endif
   if(audio_fd<0){
-    mp_msg(MSGT_AO,MSGL_ERR,"audio_setup: Can't open audio device %s: %s\n", dsp, strerror(errno));
+    mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantOpenDev, dsp, strerror(errno));
     return 0;
   }
 
 #ifdef __linux__
   /* Remove the non-blocking flag */
   if(fcntl(audio_fd, F_SETFL, 0) < 0) {
-   mp_msg(MSGT_AO,MSGL_ERR,"audio_setup: Can't make filedescriptor blocking: %s\n", strerror(errno));
+   mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantMakeFd, strerror(errno));
    return 0;
   }  
 #endif
@@ -168,7 +169,7 @@
   ao_data.format=format;
   if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &ao_data.format)<0 ||
       ao_data.format != format) if(format == AFMT_AC3){
-    mp_msg(MSGT_AO,MSGL_WARN,"Can't set audio device %s to AC3 output, trying S16...\n", dsp);
+    mp_msg(MSGT_AO,MSGL_WARN, MSGTR_AO_OSS_CantSetAC3, dsp);
 #ifdef WORDS_BIGENDIAN
     format=AFMT_S16_BE;
 #else
@@ -189,14 +190,14 @@
     if (ao_data.channels > 2) {
       if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels) == -1 ||
 	   ao_data.channels != channels ) {
-	mp_msg(MSGT_AO,MSGL_ERR,"audio_setup: Failed to set audio device to %d channels\n", channels);
+	mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantSetChans, channels);
 	return 0;
       }
     }
     else {
       int c = ao_data.channels-1;
       if (ioctl (audio_fd, SNDCTL_DSP_STEREO, &c) == -1) {
-	mp_msg(MSGT_AO,MSGL_ERR,"audio_setup: Failed to set audio device to %d channels\n", ao_data.channels);
+	mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantSetChans, ao_data.channels);
 	return 0;
       }
       ao_data.channels=c+1;
@@ -214,7 +215,7 @@
 
   if(ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &zz)==-1){
       int r=0;
-      mp_msg(MSGT_AO,MSGL_WARN,"audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(\n");
+      mp_msg(MSGT_AO,MSGL_WARN,MSGTR_AO_OSS_CantUseGetospace);
       if(ioctl(audio_fd, SNDCTL_DSP_GETBLKSIZE, &r)==-1){
           mp_msg(MSGT_AO,MSGL_V,"audio_setup: %d bytes/frag (config.h)\n",ao_data.outburst);
       } else {
@@ -245,8 +246,7 @@
     }
     free(data);
     if(ao_data.buffersize==0){
-        mp_msg(MSGT_AO,MSGL_ERR,"\n   ***  Your audio driver DOES NOT support select()  ***\n"
-          "Recompile mplayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n");
+        mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantUseSelect);
         return 0;
     }
 #endif
@@ -283,7 +283,7 @@
     uninit(1);
     audio_fd=open(dsp, O_WRONLY);
     if(audio_fd < 0){
-	mp_msg(MSGT_AO,MSGL_ERR,"\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n", strerror(errno));
+	mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantReopen, strerror(errno));
 	return;
     }
 
--- a/libao2/ao_pcm.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_pcm.c	Sat Sep 18 20:31:28 2004 +0000
@@ -8,6 +8,9 @@
 #include "afmt.h"
 #include "audio_out.h"
 #include "audio_out_internal.h"
+#include "../mp_msg.h"
+#include "../help_mp.h"
+
 
 static ao_info_t info = 
 {
@@ -111,13 +114,10 @@
 	wavhdr.data_length=le2me_32(0x7ffff000);
 	wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
 
-	printf("PCM: File: %s (%s)\n"
-	       "PCM: Samplerate: %iHz Channels: %s Format %s\n",
-	       ao_outputfilename, (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate,
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename, 
+	       (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, 
 	       (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
-	printf("PCM: Info: fastest dumping is achieved with -vc dummy -vo null\n"
-	       "PCM: Info: to write WAVE files use -waveheader (default); "
-	       "for RAW PCM -nowaveheader.\n");
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo);
 
 	fp = fopen(ao_outputfilename, "wb");
 	if(fp) {
@@ -127,7 +127,8 @@
 		}
 		return 1;
 	}
-	printf("PCM: Failed to open %s for writing!\n", ao_outputfilename);
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_PCM_CantOpenOutputFile, 
+               ao_outputfilename);
 	return 0;
 }
 
--- a/libao2/ao_sdl.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_sdl.c	Sat Sep 18 20:31:28 2004 +0000
@@ -16,6 +16,7 @@
 
 #include "../config.h"
 #include "../mp_msg.h"
+#include "../help_mp.h"
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
@@ -171,11 +172,11 @@
 	/* Allocate ring-buffer memory */
 	for(i=0;i<NUM_BUFS;i++) buffer[i]=(unsigned char *) malloc(BUFFSIZE);
 
-	mp_msg(MSGT_AO,MSGL_INFO,"SDL: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
+	mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_INFO, rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
 
 	if(ao_subdevice) {
 		setenv("SDL_AUDIODRIVER", ao_subdevice, 1);
-		mp_msg(MSGT_AO,MSGL_INFO,"SDL: using %s audio driver\n", ao_subdevice);
+		mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_DriverInfo, ao_subdevice);
 	}
 
 	ao_data.channels=channels;
@@ -209,7 +210,7 @@
 	    default:
                 aspec.format = AUDIO_S16LSB;
                 ao_data.format = AFMT_S16_LE;
-                mp_msg(MSGT_AO,MSGL_WARN,"SDL: Unsupported audio format: 0x%x.\n", format);
+                mp_msg(MSGT_AO,MSGL_WARN,MSGTR_AO_SDL_UnsupportedAudioFmt, format);
 	}
 
 	/* The desired audio frequency in samples-per-second. */
@@ -230,13 +231,13 @@
 
 	/* initialize the SDL Audio system */
         if (SDL_Init (SDL_INIT_AUDIO/*|SDL_INIT_NOPARACHUTE*/)) {
-                mp_msg(MSGT_AO,MSGL_ERR,"SDL: Initializing of SDL Audio failed: %s.\n", SDL_GetError());
+                mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_SDL_CantInit, SDL_GetError());
                 return 0;
         }
 
 	/* Open the audio device and start playing sound! */
 	if(SDL_OpenAudio(&aspec, &obtained) < 0) {
-        	mp_msg(MSGT_AO,MSGL_ERR,"SDL: Unable to open audio: %s\n", SDL_GetError());
+        	mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_SDL_CantOpenAudio, SDL_GetError());
         	return(0);
 	} 
 
@@ -264,7 +265,7 @@
 		ao_data.format = AFMT_U16_BE;
 	    break;
 	    default:
-                mp_msg(MSGT_AO,MSGL_WARN,"SDL: Unsupported SDL audio format: 0x%x.\n", obtained.format);
+                mp_msg(MSGT_AO,MSGL_WARN,MSGTR_AO_SDL_UnsupportedAudioFmt, obtained.format);
                 return 0;
 	}
 
--- a/libao2/ao_sgi.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_sgi.c	Sat Sep 18 20:31:28 2004 +0000
@@ -11,6 +11,8 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
+#include "../mp_msg.h"
+#include "../help_mp.h"
 
 static ao_info_t info = 
 {
@@ -31,7 +33,7 @@
 // to set/get/query special features/parameters
 static int control(int cmd, void *arg){
   
-  printf("ao_sgi, control\n");
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_INFO);
   
   return -1;
 }
@@ -40,7 +42,7 @@
 // return: 1=success 0=fail
 static int init(int rate, int channels, int format, int flags) {
   
-  printf("ao_sgi, init: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_InitInfo, rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
   
   { /* from /usr/share/src/dmedia/audio/setrate.c */
   
@@ -51,7 +53,7 @@
 
     rv = alGetResourceByName(AL_SYSTEM, "out.analog", AL_DEVICE_TYPE);
     if (!rv) {
-      printf("ao_sgi, play: invalid device\n");
+      mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InvalidDevice);
       return 0;
     }
     
@@ -63,20 +65,19 @@
     x[1].value.i = AL_CRYSTAL_MCLK_TYPE;
 
     if (alSetParams(rv,x, 2)<0) {
-      printf("ao_sgi, init: setparams failed: %s\n", alGetErrorString(oserror()));
-      printf("ao_sgi, init: could not set desired samplerate\n"); 
+      mp_msg(MSGT_AO, MSGL_WARN, MSGTR_AO_SGI_CantSetParms_Samplerate, alGetErrorString(oserror()));
     }
     
     if (x[0].sizeOut < 0) {
-      printf("ao_sgi, init: AL_RATE was not accepted on the given resource\n");
+      mp_msg(MSGT_AO, MSGL_WARN, MSGTR_AO_SGI_CantSetAlRate);
     }
 
     if (alGetParams(rv,x, 1)<0) {
-      printf("ao_sgi, init: getparams failed: %s\n", alGetErrorString(oserror()));
+      mp_msg(MSGT_AO, MSGL_WARN, MSGTR_AO_SGI_CantGetParms, alGetErrorString(oserror()));
     }
     
     if (frate != alFixedToDouble(x[0].value.ll)) {
-      printf("ao_sgi, init: samplerate is now %lf (desired rate is %lf)\n", alFixedToDouble(x[0].value.ll), frate);
+      mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_SampleRateInfo, alFixedToDouble(x[0].value.ll), frate);
     } 
     sample_rate = (int)frate;
   }
@@ -88,7 +89,7 @@
   ao_config = alNewConfig();
   
   if (!ao_config) {
-    printf("ao_sgi, init: %s\n", alGetErrorString(oserror()));
+    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InitConfigError, alGetErrorString(oserror()));
     return 0;
   }
   
@@ -100,14 +101,14 @@
   alSetQueueSize(ao_config, 48000);
   
   if (alSetDevice(ao_config, AL_DEFAULT_OUTPUT) < 0) {
-    printf("ao_sgi, init: %s\n", alGetErrorString(oserror()));
+    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InitConfigError, alGetErrorString(oserror()));
     return 0;
   }
   
   ao_port = alOpenPort("mplayer", "w", ao_config);
   
   if (!ao_port) {
-    printf("ao_sgi, init: Unable to open audio channel: %s\n", alGetErrorString(oserror()));
+    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SGI_InitOpenAudioFailed, alGetErrorString(oserror()));
     return 0;
   }
   
@@ -122,7 +123,7 @@
 
   /* TODO: samplerate should be set back to the value before mplayer was started! */
 
-  printf("ao_sgi, uninit: ...\n");
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_Uninit);
 
   if (ao_port) {
     while(alGetFilled(ao_port) > 0) sginap(1);  
@@ -135,21 +136,21 @@
 // stop playing and empty buffers (for seeking/pause)
 static void reset() {
   
-  printf("ao_sgi, reset: ...\n");
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_Reset);
   
 }
 
 // stop playing, keep buffers (for pause)
 static void audio_pause() {
     
-  printf("ao_sgi, audio_pause: ...\n");
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_PauseInfo);
     
 }
 
 // resume playing, after audio_pause()
 static void audio_resume() {
 
-  printf("ao_sgi, audio_resume: ...\n");
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_ResumeInfo);
 
 }
 
--- a/libao2/ao_sun.c	Sat Sep 18 18:14:25 2004 +0000
+++ b/libao2/ao_sun.c	Sat Sep 18 20:31:28 2004 +0000
@@ -26,6 +26,8 @@
 #include "audio_out.h"
 #include "audio_out_internal.h"
 #include "afmt.h"
+#include "../mp_msg.h"
+#include "../help_mp.h"
 
 static ao_info_t info = 
 {
@@ -126,13 +128,13 @@
     info.play.samples = 0;
     if (ioctl(fd, AUDIO_SETINFO, &info)) {
 	if (verbose>0)
-	    printf("rtsc: SETINFO failed\n");
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_RtscSetinfoFailed);
 	goto error;
     }
     
     if (write(fd, silence, len) != len) {
 	if (verbose>0)
-	    printf("rtsc: write failed");
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_RtscWriteFailed);
 	goto error;
     }
 
@@ -482,7 +484,7 @@
 
     audio_fd=open(audio_dev, O_WRONLY);
     if(audio_fd<0){
-	printf("Can't open audio device %s, %s  -> nosound\n", audio_dev, strerror(errno));
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_CantOpenAudioDev, audio_dev, strerror(errno));
 	return 0;
     }
 
@@ -556,7 +558,7 @@
     }
 
     if (!ok) {
-	printf("audio_setup: your card doesn't support %d channel, %s, %d Hz samplerate\n",
+	mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_UnsupSampleRate,
 	       channels, audio_out_format_name(format), rate);
 	return 0;
     }
@@ -588,8 +590,7 @@
 	}
 	free(data);
 	if(ao_data.buffersize==0){
-	    printf("\n   ***  Your audio driver DOES NOT support select()  ***\n");
-	    printf("Recompile mplayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n");
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_CantUseSelect);
 	    return 0;
 	}
 #ifdef	__svr4__
@@ -631,7 +632,7 @@
     uninit(1);
     audio_fd=open(audio_dev, O_WRONLY);
     if(audio_fd<0){
-	printf("\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE (%s) ***\n", strerror(errno));
+	mp_msg(MSGT_AO, MSGL_FATAL, MSGTR_AO_SUN_CantReopenReset, strerror(errno));
 	return;
     }