[MPlayer-cvslog] r29750 - trunk/libao2/ao_oss.c

cladisch subversion at mplayerhq.hu
Mon Oct 5 09:42:03 CEST 2009


Author: cladisch
Date: Mon Oct  5 09:42:02 2009
New Revision: 29750

Log:
fix calculation of ao_data.bps for sample formats with more than 16 bits

Modified:
   trunk/libao2/ao_oss.c

Modified: trunk/libao2/ao_oss.c
==============================================================================
--- trunk/libao2/ao_oss.c	Sun Oct  4 23:10:13 2009	(r29749)
+++ trunk/libao2/ao_oss.c	Mon Oct  5 09:42:02 2009	(r29750)
@@ -396,8 +396,19 @@ ac3_retry:
   }
 
   ao_data.bps=ao_data.channels;
-  if(ao_data.format != AF_FORMAT_U8 && ao_data.format != AF_FORMAT_S8)
+  switch (ao_data.format & AF_FORMAT_BITS_MASK) {
+  case AF_FORMAT_8BIT:
+    break;
+  case AF_FORMAT_16BIT:
     ao_data.bps*=2;
+    break;
+  case AF_FORMAT_24BIT:
+    ao_data.bps*=3;
+    break;
+  case AF_FORMAT_32BIT:
+    ao_data.bps*=4;
+    break;
+  }
 
   ao_data.outburst-=ao_data.outburst % ao_data.bps; // round down
   ao_data.bps*=ao_data.samplerate;


More information about the MPlayer-cvslog mailing list