[Mplayer-cvslog] CVS: main/libao2 ao_alsa5.c, 1.18, 1.19 ao_arts.c, 1.7, 1.8 ao_dxr2.c, 1.5, 1.6 ao_esd.c, 1.6, 1.7 ao_mpegpes.c, 1.19, 1.20 ao_null.c, 1.11, 1.12 ao_oss.c, 1.43, 1.44 ao_pcm.c, 1.20, 1.21 ao_sdl.c, 1.34, 1.35 ao_sgi.c, 1.5, 1.6 ao_sun.c, 1.27, 1.28
Ivo van Poorten CVS
syncmail at mplayerhq.hu
Sat Sep 18 22:31:30 CEST 2004
CVS change done by Ivo van Poorten CVS
Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv23472/libao2
Modified Files:
ao_alsa5.c ao_arts.c ao_dxr2.c ao_esd.c ao_mpegpes.c ao_null.c
ao_oss.c ao_pcm.c ao_sdl.c ao_sgi.c ao_sun.c
Log Message:
mp_msg transition of unmaintained audio output drivers.
Patch by Reynaldo H. Verdejo Pinochet <reynaldo at opendot dot cl>
Index: ao_alsa5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa5.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ao_alsa5.c 6 Apr 2004 17:55:36 -0000 1.18
+++ ao_alsa5.c 18 Sep 2004 20:31:27 -0000 1.19
@@ -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, ¶ms)) < 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);
Index: ao_arts.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_arts.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ao_arts.c 9 Aug 2004 23:53:37 -0000 1.7
+++ ao_arts.c 18 Sep 2004 20:31:27 -0000 1.8
@@ -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;
Index: ao_dxr2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_dxr2.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ao_dxr2.c 6 Apr 2004 17:55:36 -0000 1.5
+++ ao_dxr2.c 18 Sep 2004 20:31:27 -0000 1.6
@@ -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;
}
Index: ao_esd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_esd.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ao_esd.c 6 Apr 2004 17:55:36 -0000 1.6
+++ ao_esd.c 18 Sep 2004 20:31:27 -0000 1.7
@@ -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;
}
Index: ao_mpegpes.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_mpegpes.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ao_mpegpes.c 6 Apr 2004 17:55:36 -0000 1.19
+++ ao_mpegpes.c 18 Sep 2004 20:31:27 -0000 1.20
@@ -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
Index: ao_null.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_null.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ao_null.c 6 Apr 2004 17:55:36 -0000 1.11
+++ ao_null.c 18 Sep 2004 20:31:27 -0000 1.12
@@ -110,9 +110,3 @@
drain();
return (float) buffer / (float) ao_data.bps;
}
-
-
-
-
-
-
Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- ao_oss.c 1 May 2004 19:43:59 -0000 1.43
+++ ao_oss.c 18 Sep 2004 20:31:27 -0000 1.44
@@ -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;
}
Index: ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ao_pcm.c 6 Apr 2004 17:55:36 -0000 1.20
+++ ao_pcm.c 18 Sep 2004 20:31:27 -0000 1.21
@@ -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;
}
Index: ao_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sdl.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- ao_sdl.c 28 Jul 2004 12:17:50 -0000 1.34
+++ ao_sdl.c 18 Sep 2004 20:31:27 -0000 1.35
@@ -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;
}
Index: ao_sgi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sgi.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ao_sgi.c 6 Apr 2004 17:55:36 -0000 1.5
+++ ao_sgi.c 18 Sep 2004 20:31:27 -0000 1.6
@@ -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);
}
Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- ao_sun.c 6 Apr 2004 20:06:57 -0000 1.27
+++ ao_sun.c 18 Sep 2004 20:31:27 -0000 1.28
@@ -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;
}
More information about the MPlayer-cvslog
mailing list