[MPlayer-cvslog] CVS: main/libao2 ao_alsa.c, 1.13, 1.14 ao_alsa5.c, 1.23, 1.24 ao_dsound.c, 1.7, 1.8 ao_nas.c, 1.19, 1.20 ao_oss.c, 1.47, 1.48 ao_pcm.c, 1.23, 1.24 ao_sdl.c, 1.39, 1.40 ao_sgi.c, 1.10, 1.11 ao_sun.c, 1.33, 1.34 ao_win32.c, 1.20, 1.21

Alex Beregszaszi syncmail at mplayerhq.hu
Tue Dec 28 20:11:17 CET 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv21245

Modified Files:
	ao_alsa.c ao_alsa5.c ao_dsound.c ao_nas.c ao_oss.c ao_pcm.c 
	ao_sdl.c ao_sgi.c ao_sun.c ao_win32.c 
Log Message:
af_fmt2str_short

Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ao_alsa.c	27 Dec 2004 18:14:03 -0000	1.13
+++ ao_alsa.c	28 Dec 2004 19:11:14 -0000	1.14
@@ -334,7 +334,7 @@
 	ao_data.bps *= 4;
 	break;
       case -1:
-	mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: invalid format (%x) requested - output disabled\n",format);
+	mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: invalid format (%s) requested - output disabled\n",af_fmt2str_short(format));
 	return(0);
 	break;
       default:
@@ -586,7 +586,7 @@
                                              alsa_format)) < 0)
       {
          mp_msg(MSGT_AO,MSGL_INFO,
-		"alsa-init: format %x are not supported by hardware, trying default\n", format);
+		"alsa-init: format %s are not supported by hardware, trying default\n", af_fmt2str_short(format));
          alsa_format = SND_PCM_FORMAT_S16_LE;
          ao_data.format = AF_FORMAT_S16_LE;
          ao_data.bps = channels * rate_hz * 2;

Index: ao_alsa5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa5.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ao_alsa5.c	27 Dec 2004 19:43:13 -0000	1.23
+++ ao_alsa5.c	28 Dec 2004 19:11:14 -0000	1.24
@@ -50,10 +50,9 @@
     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, af_fmt2str(format, buf, 128));
+	channels, af_fmt2str_short(format));
 
     alsa_handler = NULL;
 
@@ -112,7 +111,7 @@
 	    ao_data.bps *= 2;
 	    break;
 	case -1:
-	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq,af_fmt2str(format,buf,128));
+	    mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq,af_fmt2str_short(format));
 	    return(0);
 	default:
 	    break;

Index: ao_dsound.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_dsound.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ao_dsound.c	27 Dec 2004 18:10:30 -0000	1.7
+++ ao_dsound.c	28 Dec 2004 19:11:14 -0000	1.8
@@ -372,7 +372,7 @@
 		case AF_FORMAT_S8:
 			break;
 		default:
-			mp_msg(MSGT_AO, MSGL_V,"ao_dsound: format %x not supported defaulting to Signed 16-bit Little-Endian\n",format);
+			mp_msg(MSGT_AO, MSGL_V,"ao_dsound: format %s not supported defaulting to Signed 16-bit Little-Endian\n",af_fmt2str_short(format));
 			format=AF_FORMAT_S16_LE;
 	}   	
 	//fill global ao_data
@@ -381,7 +381,7 @@
 	ao_data.format = format;
 	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:%x\n", rate, channels, format);
+	mp_msg(MSGT_AO, MSGL_V,"ao_dsound: Samplerate:%iHz Channels:%i Format:%s\n", rate, channels, af_fmt2str_short(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

Index: ao_nas.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_nas.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ao_nas.c	27 Dec 2004 19:43:13 -0000	1.19
+++ ao_nas.c	28 Dec 2004 19:11:14 -0000	1.20
@@ -387,13 +387,12 @@
 	int bytes_per_sample = channels * AuSizeofFormat(auformat);
 	int buffer_size;
 	char *server;
-	char buf[128];
 
 	nas_data=malloc(sizeof(struct ao_nas_data));
 	memset(nas_data, 0, sizeof(struct ao_nas_data));
 
 	mp_msg(MSGT_AO, MSGL_V, "ao2: %d Hz  %d chans  %s\n",rate,channels,
-		af_fmt2str(format,buf,128));
+		af_fmt2str_short(format));
 
 	ao_data.format = format;
 	ao_data.samplerate = rate;

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- ao_oss.c	28 Dec 2004 01:59:12 -0000	1.47
+++ ao_oss.c	28 Dec 2004 19:11:14 -0000	1.48
@@ -184,8 +184,8 @@
   char *mixer_channels [SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
   int oss_format;
 
-//  mp_msg(MSGT_AO,MSGL_V,"ao2: %d Hz  %d chans  %s\n",rate,channels,
-//    audio_out_format_name(format));
+  mp_msg(MSGT_AO,MSGL_V,"ao2: %d Hz  %d chans  %s\n",rate,channels,
+    af_fmt2str_short(format));
 
   if (ao_subdevice)
     dsp = ao_subdevice;
@@ -275,8 +275,6 @@
 #endif
     goto ac3_retry;
   }
-//  mp_msg(MSGT_AO,MSGL_V,"audio_setup: sample format: %s (requested: %s)\n",
-//    audio_out_format_name(ao_data.format), audio_out_format_name(format));
 #if 0
   if(oss_format!=format2oss(format))
 	mp_msg(MSGT_AO,MSGL_WARN,"WARNING! Your soundcard does NOT support %s sample format! Broken audio or bad playback speed are possible! Try with '-aop list=format'\n",audio_out_format_name(format));
@@ -284,6 +282,9 @@
 
   ao_data.format = oss2format(oss_format);
   if (ao_data.format == -1) return 0;
+
+  mp_msg(MSGT_AO,MSGL_V,"audio_setup: sample format: %s (requested: %s)\n",
+    af_fmt2str_short(ao_data.format), af_fmt2str_short(format));
   
   ao_data.channels = channels;
   if(format != AF_FORMAT_AC3) {

Index: ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ao_pcm.c	27 Dec 2004 17:30:14 -0000	1.23
+++ ao_pcm.c	28 Dec 2004 19:11:14 -0000	1.24
@@ -114,9 +114,9 @@
 	wavhdr.data_length=le2me_32(0x7ffff000);
 	wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
 
-//	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));
+	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename, 
+	       (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, 
+	       (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format));
 	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo);
 
 	fp = fopen(ao_outputfilename, "wb");

Index: ao_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sdl.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ao_sdl.c	27 Dec 2004 17:30:14 -0000	1.39
+++ ao_sdl.c	28 Dec 2004 19:11:14 -0000	1.40
@@ -181,7 +181,7 @@
 	/* Allocate ring-buffer memory */
 	buffer = (unsigned char *) malloc(BUFFSIZE);
 
-//	mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_INFO, 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", af_fmt2str_short(format));
 
 	if(ao_subdevice) {
 		setenv("SDL_AUDIODRIVER", ao_subdevice, 1);

Index: ao_sgi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sgi.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ao_sgi.c	27 Dec 2004 19:43:13 -0000	1.10
+++ ao_sgi.c	28 Dec 2004 19:11:14 -0000	1.11
@@ -42,8 +42,7 @@
 // return: 1=success 0=fail
 static int init(int rate, int channels, int format, int flags) {
 
-  char buf[128];  
-  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_InitInfo, rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str(format, buf, 128));
+  mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_SGI_InitInfo, rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format));
   
   { /* from /usr/share/src/dmedia/audio/setrate.c */
   

Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- ao_sun.c	27 Dec 2004 19:43:13 -0000	1.33
+++ ao_sun.c	28 Dec 2004 19:11:14 -0000	1.34
@@ -466,8 +466,8 @@
 	enable_sample_timing = realtime_samplecounter_available(audio_dev);
     }
 
-//    printf("ao2: %d Hz  %d chans  %s [0x%X]\n",
-//	   rate,channels,audio_out_format_name(format),format);
+    printf("ao2: %d Hz  %d chans  %s [0x%X]\n",
+	   rate,channels,af_fmt2str_short(format),format);
 
     audio_fd=open(audio_dev, O_WRONLY);
     if(audio_fd<0){

Index: ao_win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_win32.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ao_win32.c	27 Dec 2004 18:10:30 -0000	1.20
+++ ao_win32.c	28 Dec 2004 19:11:14 -0000	1.21
@@ -147,7 +147,6 @@
 	MMRESULT result;
 	unsigned char* buffer;
 	int i;
-	char buf[128];
    
 	switch(format){
 		case AF_FORMAT_AC3:
@@ -156,7 +155,7 @@
 		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",af_fmt2str(format, &buf, 128));
+			mp_msg(MSGT_AO, MSGL_V,"ao_win32: format %s not supported defaulting to Signed 16-bit Little-Endian\n",af_fmt2str_short(format));
 			format=AF_FORMAT_S16_LE;
 	}   
 	//fill global ao_data 
@@ -168,11 +167,11 @@
 	  ao_data.bps*=2;
 	if(ao_data.buffersize==-1)
 	{
-		ao_data.buffersize=audio_out_format_bits(format)/8;
+		ao_data.buffersize=af_fmt2bits(format)/8;
         ao_data.buffersize*= channels;
 		ao_data.buffersize*= SAMPLESIZE;
 	}
-	mp_msg(MSGT_AO, MSGL_V,"ao_win32: Samplerate:%iHz Channels:%i Format:%s\n",rate, channels, audio_out_format_name(format));
+	mp_msg(MSGT_AO, MSGL_V,"ao_win32: Samplerate:%iHz Channels:%i Format:%s\n",rate, channels, af_fmt2str_short(format));
     mp_msg(MSGT_AO, MSGL_V,"ao_win32: Buffersize:%d\n",ao_data.buffersize);
 	
 	//fill waveformatex
@@ -189,14 +188,14 @@
     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);
     }
 	if(channels>2)
 	{
         wformat.dwChannelMask = channel_mask[channels-3];
         wformat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
-	    wformat.Samples.wValidBitsPerSample=audio_out_format_bits(format);
+	    wformat.Samples.wValidBitsPerSample=af_fmt2bits(format);
     }
   
     wformat.Format.nAvgBytesPerSec = wformat.Format.nSamplesPerSec * wformat.Format.nBlockAlign;




More information about the MPlayer-cvslog mailing list