[Mplayer-cvslog] CVS: main/libao2 ao_alsa9.c,1.27,1.28

Arpi of Ize arpi at mplayerhq.hu
Wed Dec 4 22:42:25 CET 2002


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv1196

Modified Files:
	ao_alsa9.c 
Log Message:
The enclosed patch should fix problems associated with playing 8-bit wide
audio samples (or anything other than 16-bit samples, for that matter)
using the alsa9 ao driver.
patch by "R.L. Horn" <eastcheap at fastmail.fm>


Index: ao_alsa9.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa9.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- ao_alsa9.c	2 Nov 2002 10:59:27 -0000	1.27
+++ ao_alsa9.c	4 Dec 2002 21:42:22 -0000	1.28
@@ -853,10 +853,10 @@
 
   //bytes_per_sample is always 4 for 2 chn S16_LE
   int num_frames = len / bytes_per_sample;
-  signed short *output_samples=data;
+  char *output_samples = (char *)data;
   snd_pcm_sframes_t res = 0;
 
-  //printf("alsa-play: frames=%i, len=%i",num_frames,len);
+  //fprintf(stderr,"alsa-play: frames=%i, len=%i\n",num_frames,len);
 
   if (!alsa_handler) {
     printf("alsa-play: device configuration error");
@@ -891,7 +891,10 @@
       }
 
       if (res > 0) {
-	output_samples += ao_data.channels * res;
+
+	/* output_samples += ao_data.channels * res; */
+	output_samples += res * bytes_per_sample;
+
 	num_frames -= res;
       }
 




More information about the MPlayer-cvslog mailing list