diff options
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_alsa.c | 10 | ||||
-rw-r--r-- | libao2/ao_alsa5.c | 6 | ||||
-rw-r--r-- | libao2/ao_dsound.c | 10 | ||||
-rw-r--r-- | libao2/ao_sgi.c | 5 | ||||
-rw-r--r-- | libao2/ao_sun.c | 7 | ||||
-rw-r--r-- | libao2/ao_win32.c | 3 |
6 files changed, 21 insertions, 20 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 539fd0fa7c..db23f1b532 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -256,8 +256,8 @@ static int init(int rate_hz, int channels, int format, int flags) // make sure alsa_device is null-terminated even when using strncpy etc. memset(alsa_device, 0, ALSA_DEVICE_SIZE + 1); - mp_msg(MSGT_AO,MSGL_V,"alsa-init: requested format: %d Hz, %d channels, %s\n", rate_hz, - channels, audio_out_format_name(format)); + mp_msg(MSGT_AO,MSGL_V,"alsa-init: requested format: %d Hz, %d channels, %x\n", rate_hz, + channels, format); alsa_handler = NULL; mp_msg(MSGT_AO,MSGL_V,"alsa-init: compiled for ALSA-%s\n", SND_LIB_VERSION_STR); @@ -334,8 +334,7 @@ static int init(int rate_hz, int channels, int format, int flags) ao_data.bps *= 4; break; case -1: - mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: invalid format (%s) requested - output disabled\n", - audio_out_format_name(format)); + mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: invalid format (%x) requested - output disabled\n",format); return(0); break; default: @@ -587,8 +586,7 @@ static int init(int rate_hz, int channels, int format, int flags) alsa_format)) < 0) { mp_msg(MSGT_AO,MSGL_INFO, - "alsa-init: format %s are not supported by hardware, trying default\n", - audio_out_format_name(format)); + "alsa-init: format %x are not supported by hardware, trying default\n", format); alsa_format = SND_PCM_FORMAT_S16_LE; ao_data.format = AF_FORMAT_S16_LE; ao_data.bps = channels * rate_hz * 2; diff --git a/libao2/ao_alsa5.c b/libao2/ao_alsa5.c index ed073f55ae..687b48ac8c 100644 --- a/libao2/ao_alsa5.c +++ b/libao2/ao_alsa5.c @@ -50,9 +50,10 @@ static int init(int rate_hz, int channels, int format, int flags) snd_pcm_channel_setup_t setup; snd_pcm_info_t info; snd_pcm_channel_info_t chninfo; + char buf[128]; mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ALSA5_InitInfo, rate_hz, - channels, audio_out_format_name(format)); + channels, af_fmt2str(format)); alsa_handler = NULL; @@ -111,8 +112,7 @@ static int init(int rate_hz, int channels, int format, int flags) ao_data.bps *= 2; break; case -1: - mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq, - audio_out_format_name(format)); + mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq,af_fmt2str(format,&buf,128)); return(0); default: break; diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index 39ab901df8..bcdce0b1a0 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -274,7 +274,7 @@ static int write_buffer(unsigned char *data, int len) int i, j; int numsamp,sampsize; - sampsize = audio_out_format_bits(ao_data.format)>>3; // bytes per sample + sampsize = af_fmt2bits(ao_data.format)>>3; // bytes per sample numsamp = dwBytes1 / (ao_data.channels * sampsize); // number of samples for each channel in this buffer for( i = 0; i < numsamp; i++ ) for( j = 0; j < ao_data.channels; j++ ) { @@ -372,16 +372,16 @@ static int init(int rate, int channels, int format, int flags) case AF_FORMAT_S8: break; default: - mp_msg(MSGT_AO, MSGL_V,"ao_dsound: format %s not supported defaulting to Signed 16-bit Little-Endian\n",audio_out_format_name(format)); + mp_msg(MSGT_AO, MSGL_V,"ao_dsound: format %x not supported defaulting to Signed 16-bit Little-Endian\n",format); format=AF_FORMAT_S16_LE; } //fill global ao_data ao_data.channels = channels; ao_data.samplerate = rate; ao_data.format = format; - ao_data.bps = channels * rate * (audio_out_format_bits(format)>>3); + ao_data.bps = channels * rate * (af_fmt2bits(format)>>3); if(ao_data.buffersize==-1) ao_data.buffersize = ao_data.bps; // space for 1 sec - mp_msg(MSGT_AO, MSGL_V,"ao_dsound: Samplerate:%iHz Channels:%i Format:%s\n", rate, channels, audio_out_format_name(format)); + mp_msg(MSGT_AO, MSGL_V,"ao_dsound: Samplerate:%iHz Channels:%i Format:%x\n", rate, channels, format); mp_msg(MSGT_AO, MSGL_V,"ao_dsound: Buffersize:%d bytes (%d msec)\n", ao_data.buffersize, ao_data.buffersize / ao_data.bps * 1000); //fill waveformatex @@ -395,7 +395,7 @@ static int init(int rate, int channels, int format, int flags) wformat.Format.nBlockAlign = 4; } else { wformat.Format.wFormatTag = (channels > 2) ? WAVE_FORMAT_EXTENSIBLE : WAVE_FORMAT_PCM; - wformat.Format.wBitsPerSample = audio_out_format_bits(format); + wformat.Format.wBitsPerSample = af_fmt2bits(format); wformat.Format.nBlockAlign = wformat.Format.nChannels * (wformat.Format.wBitsPerSample >> 3); } diff --git a/libao2/ao_sgi.c b/libao2/ao_sgi.c index d1c6ef2d1d..796691ab4e 100644 --- a/libao2/ao_sgi.c +++ b/libao2/ao_sgi.c @@ -41,8 +41,9 @@ static int control(int cmd, void *arg){ // open & setup audio device // return: 1=success 0=fail static int init(int rate, int channels, int format, int flags) { - - mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_InitInfo, rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format)); + + char buf[128]; + mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_InitInfo, rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str(format, &buf, 128)); { /* from /usr/share/src/dmedia/audio/setrate.c */ diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c index b9b6a3a9f4..2e102ccfa1 100644 --- a/libao2/ao_sun.c +++ b/libao2/ao_sun.c @@ -457,6 +457,7 @@ static int init(int rate,int channels,int format,int flags){ audio_info_t info; int pass; int ok; + char buf[128]; setup_device_paths(); @@ -479,7 +480,7 @@ static int init(int rate,int channels,int format,int flags){ for (ok = pass = 0; pass <= 5; pass++) { /* pass 6&7 not useful */ AUDIO_INITINFO(&info); - info.play.encoding = oss2sunfmt(ao_data.format = format); + info.play.encoding = af2sunfmt(ao_data.format = format); info.play.precision = (format==AF_FORMAT_S16_LE || format==AF_FORMAT_S16_BE ? AUDIO_PRECISION_16 @@ -545,7 +546,7 @@ static int init(int rate,int channels,int format,int flags){ if (!ok) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_UnsupSampleRate, - channels, audio_out_format_name(format), rate); + channels, af_fmt2str(format, &buf, 128), rate); return 0; } @@ -625,7 +626,7 @@ static void reset(){ ioctl(audio_fd, AUDIO_DRAIN, 0); AUDIO_INITINFO(&info); - info.play.encoding = oss2sunfmt(ao_data.format); + info.play.encoding = af2sunfmt(ao_data.format); info.play.precision = (ao_data.format==AF_FORMAT_S16_LE || ao_data.format==AF_FORMAT_S16_BE ? AUDIO_PRECISION_16 diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index e589ced8c1..ff07a9e73c 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -147,6 +147,7 @@ static int init(int rate,int channels,int format,int flags) MMRESULT result; unsigned char* buffer; int i; + char buf[128]; switch(format){ case AF_FORMAT_AC3: @@ -155,7 +156,7 @@ static int init(int rate,int channels,int format,int flags) case AF_FORMAT_S8: break; default: - mp_msg(MSGT_AO, MSGL_V,"ao_win32: format %s not supported defaulting to Signed 16-bit Little-Endian\n",audio_out_format_name(format)); + mp_msg(MSGT_AO, MSGL_V,"ao_win32: format %s not supported defaulting to Signed 16-bit Little-Endian\n",af_fmt2str(format, &buf, 128)); format=AF_FORMAT_S16_LE; } //fill global ao_data |