[MPlayer-dev-eng] [PATCH] libao2/unmaintained to mp_msg/help_mp transition

Reynaldo H. Verdejo Pinochet reynaldo at opendot.cl
Sat Sep 18 02:04:34 CEST 2004


Hi all

This ones makes every libao2 unmaintained driver to use mp_msg
instead of printf and puts all translatable strings from INFO
and up into help_mp, only one left is ao_pluggin, i just missed it ;)

This time i dont include any spanish translation, lets make
those translators work ;)

Regards

  Reynaldo

-------------- next part --------------
--- help/help_mp-en.h	2004-09-16 22:40:09.000000000 -0400
+++ ../my_main/help/help_mp-en.h	2004-09-17 19:17:16.000000000 -0400
@@ -172,6 +172,103 @@
 "[%f]. Entries must be in chronological order, cannot overlap. Discarding.\n"
 #define MSGTR_EdlBadLineBadStop "Stop time has to be after start time.\n"
 
+// libao2 
+
+
+// ao_oss.c
+#define MSGTR_AOOSS_CantOpenMixer "[AO OSS] audio_setup: Can't open mixer device %s: %s\n"
+#define MSGTR_AOOSS_ChanNotFound "[AO OSS] audio_setup: Audio card mixer does not have channel '%s' using default.\n"
+#define MSGTR_AOOSS_CantOpenDev "[AO OSS] audio_setup: Can't open audio device %s: %s\n"
+#define MSGTR_AOOSS_CantMakeFd "[AO OSS] audio_setup: Can't make filedescriptor blocking: %s\n"
+#define MSGTR_AOOSS_CantSetAC3 "[AO OSS] Can't set audio device %s to AC3 output, trying S16...\n"
+#define MSGTR_AOOSS_CantSetChans "[AO OSS] audio_setup: Failed to set audio device to %d channels.\n"
+#define MSGTR_AOOSS_CantUseGetospace "[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(\n"
+#define MSGTR_AOOSS_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_AOOSS_CantReopen "[AO OSS]\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n"
+
+// ao_arts.c
+#define MSGTR_AOARTS_CantInit "[AO ARTS] %s\n"
+#define MSGTR_AOARTS_ServerConnect "[AO ARTS] Connected to sound server.\n"
+#define MSGTR_AOARTS_CantOpenStream "[AO ARTS] Unable to open a stream.\n"
+#define MSGTR_AOARTS_StreamOpen "[AO ARTS] Stream opened.\n"
+#define MSGTR_AOARTS_BufferSize "[AO ARTS] buffer size: %d\n"
+
+// ao_dxr2.c
+#define MSGTR_AODXR2_SetVolFailed "[AO DXR2] Setting volume to %d failed.\n"
+#define MSGTR_AODXR2_UnsupSamplerate "[AO DXR2] dxr2: %d Hz not supported, try \"-aop list=resample\"\n"
+
+// ao_esd.c
+#define MSGTR_AOESD_CantOpenSound "[AO ESD] esd_open_sound failed: %s\n"
+#define MSGTR_AOESD_LatencyInfo "[AO ESD] latency: [server: %0.2fs, net: %0.2fs] (adjust %0.2fs)\n"
+#define MSGTR_AOESD_CantOpenPBStream "[AO ESD] failed to open esd playback stream: %s\n"
+
+// ao_mpegpes.c
+#define MSGTR_AOMPEGPES_CantSetMixer "[AO MPEGPES] DVB audio set mixer failed: %s\n" 
+#define MSGTR_AOMPEGPES_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_AOPCM_FileInfo "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n"
+#define MSGTR_AOPCM_HintInfo "[AO PCM] Info: fastest dumping is achieved with -vc dummy -vo null\nPCM: Info: to write WAVE files use -waveheader (default)."
+#define MSGTR_AOPCM_CantOpenOutputFile "[AO PCM] Failed to open %s for writing!\n"
+
+// ao_sdl.c
+#define MSGTR_AOSDL_INFO "[AO SDL] Samplerate: %iHz Channels: %s Format %s\n"
+#define MSGTR_AOSDL_DriverInfo "[AO SDL] using %s audio driver.\n"
+#define MSGTR_AOSDL_UnsupportedAudioFmt "[AO SDL] Unsupported audio format: 0x%x.\n"
+#define MSGTR_AOSDL_CantInit "[AO SDL] Initializing of SDL Audio failed: %s\n"
+#define MSGTR_AOSDL_CantOpenAudio "[AO SDL] Unable to open audio: %s\n"
+
+// ao_sgi.c
+#define MSGTR_AOSGI_INFO "[AO SGI] control.\n"
+#define MSGTR_AOSGI_InitInfo "[AO SGI] init: Samplerate: %iHz Channels: %s Format %s\n"
+#define MSGTR_AOSGI_InvalidDevice "[AO SGI] play: invalid device.\n"
+#define MSGTR_AOSGI_CantSetParms_Samplerate "[AO SGI] init: setparams failed: %s\nCould not set desired samplerate.\n"
+#define MSGTR_AOSGI_CantSetAlRate "[AO SGI] init: AL_RATE was not accepted on the given resource.\n"
+#define MSGTR_AOSGI_CantGetParms "[AO SGI] init: getparams failed: %s\n"
+#define MSGTR_AOSGI_SampleRateInfo "[AO SGI] init: samplerate is now %lf (desired rate is %lf)\n"
+#define MSGTR_AOSGI_InitConfigError "[AO SGI] init: %s\n"
+#define MSGTR_AOSGI_InitOpenAudioFailed "[AO SGI] init: Unable to open audio channel: %s\n"
+#define MSGTR_AOSGI_Uninit "[AO SGI] uninit: ...\n"
+#define MSGTR_AOSGI_Reset "[AO SGI] reset: ...\n"
+#define MSGTR_AOSGI_PauseInfo "[AO SGI] audio_pause: ...\n"
+#define MSGTR_AOSGI_ResumeInfo "[AO SGI] audio_resume: ...\n"
+
+// ao_sun.c
+#define MSGTR_AOSUN_RtscSetinfoFailed "[AO SUN] rtsc: SETINFO failed.\n"
+#define MSGTR_AOSUN_RtscWriteFailed "[AO SUN] rtsc: write failed."
+#define MSGTR_AOSUN_CantOpenAudioDev "[AO SUN] Can't open audio device %s, %s  -> nosound.\n"
+#define MSGTR_AOSUN_UnsupSampleRate "[AO SUN] audio_setup: your card doesn't support %d channel, %s, %d Hz samplerate.\n"
+#define MSGTR_AOSUN_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_AOSUN_CantReopenReset "[AO SUN]\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE (%s) ***\n"
+
+// ao_alsa5.c
+#define MSGTR_AOALSA5_InitInfo "[AO ALSA5] alsa-init: requested format: %d Hz, %d channels, %s\n"
+#define MSGTR_AOALSA5_SoundCardNotFound "[AO ALSA5] alsa-init: no soundcards found.\n"
+#define MSGTR_AOALSA5_InvalidFormatReq "[AO ALSA5] alsa-init: invalid format (%s) requested - output disabled.\n"
+#define MSGTR_AOALSA5_PlayBackError "[AO ALSA5] alsa-init: playback open error: %s\n"
+#define MSGTR_AOALSA5_PcmInfoError "[AO ALSA5] alsa-init: pcm info error: %s\n"
+#define MSGTR_AOALSA5_SoundcardsFound "[AO ALSA5] alsa-init: %d soundcard(s) found, using: %s\n"
+#define MSGTR_AOALSA5_PcmChanInfoError "[AO ALSA5] alsa-init: pcm channel info error: %s\n"
+#define MSGTR_AOALSA5_CantSetParms "[AO ALSA5] alsa-init: error setting parameters: %s\n"
+#define MSGTR_AOALSA5_CantSetChan "[AO ALSA5] alsa-init: error setting up channel: %s\n"
+#define MSGTR_AOALSA5_ChanPrepareError "[AO ALSA5] alsa-init: channel prepare error: %s\n"
+#define MSGTR_AOALSA5_DrainError "[AO ALSA5] alsa-uninit: playback drain error: %s\n"
+#define MSGTR_AOALSA5_FlushError "[AO ALSA5] alsa-uninit: playback flush error: %s\n"
+#define MSGTR_AOALSA5_PcmCloseError "[AO ALSA5] alsa-uninit: pcm close error: %s\n"
+#define MSGTR_AOALSA5_ResetDrainError "[AO ALSA5] alsa-reset: playback drain error: %s\n"
+#define MSGTR_AOALSA5_ResetFlushError "[AO ALSA5] alsa-reset: playback flush error: %s\n"
+#define MSGTR_AOALSA5_ResetChanPrepareError "[AO ALSA5] alsa-reset: channel prepare error: %s\n"
+#define MSGTR_AOALSA5_PauseDrainError "[AO ALSA5] alsa-pause: playback drain error: %s\n"
+#define MSGTR_AOALSA5_PauseFlushError "[AO ALSA5] alsa-pause: playback flush error: %s\n"
+#define MSGTR_AOALSA5_ResumePrepareError "[AO ALSA5] alsa-resume: channel prepare error: %s\n"
+#define MSGTR_AOALSA5_Underrun "[AO ALSA5] alsa-play: alsa underrun, resetting stream.\n"
+#define MSGTR_AOALSA5_PlaybackPrepareError "[AO ALSA5] alsa-play: playback prepare error: %s\n"
+#define MSGTR_AOALSA5_WriteErrorAfterReset "[AO ALSA5] alsa-play: write error after reset: %s - giving up.\n"
+#define MSGTR_AOALSA5_OutPutError "[AO ALSA5] alsa-play: output error: %s\n"
+
 // mencoder.c:
 
 #define MSGTR_UsingPass3ControllFile "Using pass3 control file: %s\n"
--- libao2/ao_alsa5.c	2004-04-06 13:55:36.000000000 -0400
+++ ../my_main/libao2/ao_alsa5.c	2004-09-17 19:16:32.000000000 -0400
@@ -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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_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_AOALSA5_OutPutError, snd_strerror(got_len));
 	return(0);
     }
     return(got_len);
--- libao2/ao_arts.c	2004-08-09 19:53:37.000000000 -0400
+++ ../my_main/libao2/ao_arts.c	2004-09-17 16:45:21.000000000 -0400
@@ -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_AOARTS_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_AOARTS_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_AOARTS_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_AOARTS_StreamOpen);
 
-	mp_msg(MSGT_AO, MSGL_INFO,"AO: [arts] buffer size: %d\n",
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AOARTS_BufferSize,
 	    ao_data.buffersize);
-	mp_msg(MSGT_AO, MSGL_INFO,"AO: [arts] packet size: %d\n",
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AOARTS_BufferSize,
 	    arts_stream_get(stream, ARTS_P_PACKET_SIZE));
 
 	return 1;
--- libao2/ao_dxr2.c	2004-04-06 13:55:36.000000000 -0400
+++ ../my_main/libao2/ao_dxr2.c	2004-09-17 17:02:40.000000000 -0400
@@ -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_AODXR2_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_AODXR2_UnsupSamplerate,rate);
 		return 0;
 	}
 
--- libao2/ao_esd.c	2004-04-06 13:55:36.000000000 -0400
+++ ../my_main/libao2/ao_esd.c	2004-09-17 17:09:55.000000000 -0400
@@ -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_AOESD_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_AOESD_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_AOESD_CantOpenPBStream, strerror(errno));
 	return 0;
     }
 
--- libao2/ao_mpegpes.c	2004-04-06 13:55:36.000000000 -0400
+++ ../my_main/libao2/ao_mpegpes.c	2004-09-17 17:14:30.000000000 -0400
@@ -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_AOMPEGPES_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_AOMPEGPES_UnsupSamplerate, rate);
 #if 0
 	    if(rate>48000) rate=96000; else
 	    if(rate>44100) rate=48000; else
--- libao2/ao_null.c	2004-04-06 13:55:36.000000000 -0400
+++ ../my_main/libao2/ao_null.c	2004-09-17 17:18:20.000000000 -0400
@@ -110,9 +110,3 @@
     drain();
     return (float) buffer / (float) ao_data.bps;
 }
-
-
-
-
-
-
--- libao2/ao_oss.c	2004-05-01 15:43:59.000000000 -0400
+++ ../my_main/libao2/ao_oss.c	2004-09-17 16:37:14.000000000 -0400
@@ -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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_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_AOOSS_CantReopen, strerror(errno));
 	return;
     }
 
--- libao2/ao_pcm.c	2004-04-06 13:55:36.000000000 -0400
+++ ../my_main/libao2/ao_pcm.c	2004-09-17 17:35:09.000000000 -0400
@@ -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_AOPCM_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_AOPCM_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_AOPCM_CantOpenOutputFile, 
+               ao_outputfilename);
 	return 0;
 }
 
--- libao2/ao_sdl.c	2004-07-28 08:17:50.000000000 -0400
+++ ../my_main/libao2/ao_sdl.c	2004-09-17 17:48:54.000000000 -0400
@@ -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_AOSDL_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_AOSDL_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_AOSDL_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_AOSDL_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_AOSDL_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_AOSDL_UnsupportedAudioFmt, obtained.format);
                 return 0;
 	}
 
--- libao2/ao_sgi.c	2004-04-06 13:55:36.000000000 -0400
+++ ../my_main/libao2/ao_sgi.c	2004-09-17 18:19:30.000000000 -0400
@@ -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_AOSGI_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_AOSGI_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_AOSGI_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_AOSGI_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_AOSGI_CantSetAlRate);
     }
 
     if (alGetParams(rv,x, 1)<0) {
-      printf("ao_sgi, init: getparams failed: %s\n", alGetErrorString(oserror()));
+      mp_msg(MSGT_AO, MSGL_WARN, MSGTR_AOSGI_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_AOSGI_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_AOSGI_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_AOSGI_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_AOSGI_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_AOSGI_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_AOSGI_Reset);
   
 }
 
 // stop playing, keep buffers (for pause)
 static void audio_pause() {
     
-  printf("ao_sgi, audio_pause: ...\n");
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AOSGI_PauseInfo);
     
 }
 
 // resume playing, after audio_pause()
 static void audio_resume() {
 
-  printf("ao_sgi, audio_resume: ...\n");
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AOSGI_ResumeInfo);
 
 }
 
--- libao2/ao_sun.c	2004-04-06 16:06:57.000000000 -0400
+++ ../my_main/libao2/ao_sun.c	2004-09-17 18:33:06.000000000 -0400
@@ -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_AOSUN_RtscSetinfoFailed);
 	goto error;
     }
     
     if (write(fd, silence, len) != len) {
 	if (verbose>0)
-	    printf("rtsc: write failed");
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AOSUN_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_AOSUN_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_AOSUN_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_AOSUN_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_AOSUN_CantReopenReset, strerror(errno));
 	return;
     }
 
--- AUTHORS	2004-09-16 20:23:11.000000000 -0400
+++ ../my_main/AUTHORS	2004-09-17 19:32:58.000000000 -0400
@@ -671,6 +671,7 @@
 
 Verdejo Pinochet, Reynaldo H. (reynaldo) <reynaldo at opendot.cl>
     * improved EDL support
+    * mp_msg transition on unmantained libao2 drivers
 
 Wigren, Per <wigren at home.se>
     * bmovl - Bitmap Overlay video filter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040917/a741e947/attachment.pgp>


More information about the MPlayer-dev-eng mailing list