changeset 8874:b8551709823d

Workaround for returning very litte buffer space.
author filon
date Fri, 10 Jan 2003 18:28:18 +0000
parents d614cfb52a42
children c567d5fb23d7
files libao2/ao_alsa1x.c libao2/ao_alsa9.c
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_alsa1x.c	Fri Jan 10 17:17:41 2003 +0000
+++ b/libao2/ao_alsa1x.c	Fri Jan 10 18:28:18 2003 +0000
@@ -59,6 +59,8 @@
 static int alsa_fragcount = 16;
 static int chunk_size = 1024; //is alsa_fragsize / 4
 
+#define MIN_CHUNK_SIZE 1024
+
 static size_t bits_per_sample, bytes_per_sample, bits_per_frame;
 static size_t chunk_bytes;
 
@@ -1084,6 +1086,10 @@
       ret = 0;
     }
  
+    // workaround for too small value returned
+    if (ret < MIN_CHUNK_SIZE)
+      ret = 0;
+
     return(ret);
 }
 
--- a/libao2/ao_alsa9.c	Fri Jan 10 17:17:41 2003 +0000
+++ b/libao2/ao_alsa9.c	Fri Jan 10 18:28:18 2003 +0000
@@ -59,6 +59,8 @@
 static int alsa_fragcount = 16;
 static int chunk_size = 1024; //is alsa_fragsize / 4
 
+#define MIN_CHUNK_SIZE 1024
+
 static size_t bits_per_sample, bytes_per_sample, bits_per_frame;
 static size_t chunk_bytes;
 
@@ -1084,6 +1086,10 @@
       ret = 0;
     }
  
+    // workaround for too small value returned
+    if (ret < MIN_CHUNK_SIZE)
+      ret = 0;
+
     return(ret);
 }