[MPlayer-cvslog] CVS: main/libao2 ao_alsa.c, 1.11, 1.12 ao_alsa5.c, 1.21, 1.22 ao_dsound.c, 1.6, 1.7 ao_sgi.c, 1.8, 1.9 ao_sun.c, 1.31, 1.32 ao_win32.c, 1.19, 1.20

Alex Beregszaszi syncmail at mplayerhq.hu
Mon Dec 27 19:10:32 CET 2004


CVS change done by Alex Beregszaszi

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

Modified Files:
	ao_alsa.c ao_alsa5.c ao_dsound.c ao_sgi.c ao_sun.c ao_win32.c 
Log Message:
hopefully final fix

Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ao_alsa.c	27 Dec 2004 17:30:13 -0000	1.11
+++ ao_alsa.c	27 Dec 2004 18:10:30 -0000	1.12
@@ -256,8 +256,8 @@
     // 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 @@
 	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 @@
                                              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;

Index: ao_alsa5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa5.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ao_alsa5.c	27 Dec 2004 17:30:13 -0000	1.21
+++ ao_alsa5.c	27 Dec 2004 18:10:30 -0000	1.22
@@ -50,9 +50,10 @@
     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 @@
 	    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;

Index: ao_dsound.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_dsound.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ao_dsound.c	27 Dec 2004 17:30:13 -0000	1.6
+++ ao_dsound.c	27 Dec 2004 18:10:30 -0000	1.7
@@ -274,7 +274,7 @@
   	    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 @@
 		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 @@
 		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);
 	}
 

Index: ao_sgi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sgi.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ao_sgi.c	7 Dec 2004 02:24:15 -0000	1.8
+++ ao_sgi.c	27 Dec 2004 18:10:30 -0000	1.9
@@ -41,8 +41,9 @@
 // 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 */
   

Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- ao_sun.c	27 Dec 2004 17:49:52 -0000	1.31
+++ ao_sun.c	27 Dec 2004 18:10:30 -0000	1.32
@@ -457,6 +457,7 @@
     audio_info_t info;
     int pass;
     int ok;
+    char buf[128];
 
     setup_device_paths();
 
@@ -479,7 +480,7 @@
     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 @@
 
     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 @@
     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

Index: ao_win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_win32.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ao_win32.c	27 Dec 2004 17:30:14 -0000	1.19
+++ ao_win32.c	27 Dec 2004 18:10:30 -0000	1.20
@@ -147,6 +147,7 @@
 	MMRESULT result;
 	unsigned char* buffer;
 	int i;
+	char buf[128];
    
 	switch(format){
 		case AF_FORMAT_AC3:
@@ -155,7 +156,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",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 




More information about the MPlayer-cvslog mailing list