[Mplayer-cvslog] CVS: main/libao2 ao_oss.c,1.35,1.36

Arpi of Ize arpi at mplayerhq.hu
Sat Dec 28 14:45:08 CET 2002


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

Modified Files:
	ao_oss.c 
Log Message:
ao_oss was not using the channel & format returned by the soundcard
for ao_data.bps calcualtion - hence fscked up av sync if soundcard didn't
support a number of channels or audio format.

patch by Balatoni Denes <pnis at coder.hu>


Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- ao_oss.c	28 Nov 2002 16:15:13 -0000	1.35
+++ ao_oss.c	28 Dec 2002 13:45:04 -0000	1.36
@@ -126,10 +126,6 @@
   fcntl(audio_fd, F_SETFD, FD_CLOEXEC);
 #endif
   
-  ao_data.bps=channels;
-  if(format != AFMT_U8 && format != AFMT_S8)
-    ao_data.bps*=2;
-
   if(format == AFMT_AC3) {
     ao_data.samplerate=rate;
     ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate);
@@ -223,8 +219,12 @@
 #endif
   }
 
+  ao_data.bps=ao_data.channels;
+  if(ao_data.format != AFMT_U8 && ao_data.format != AFMT_S8)
+    ao_data.bps*=2;
+
   ao_data.outburst-=ao_data.outburst % ao_data.bps; // round down
-  ao_data.bps*=rate;
+  ao_data.bps*=ao_data.samplerate;
 
     return 1;
 }




More information about the MPlayer-cvslog mailing list