changeset 29126:f951680cfea2

Simplify: use av_fifo_space
author reimar
date Fri, 10 Apr 2009 14:41:18 +0000
parents 06d672bbf74c
children d22a57af2835
files libao2/ao_jack.c libao2/ao_sdl.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_jack.c	Fri Apr 10 13:38:57 2009 +0000
+++ b/libao2/ao_jack.c	Fri Apr 10 14:41:18 2009 +0000
@@ -82,7 +82,7 @@
  * If there is not enough room, the buffer is filled up
  */
 static int write_buffer(unsigned char* data, int len) {
-  int free = BUFFSIZE - av_fifo_size(buffer);
+  int free = av_fifo_space(buffer);
   if (len > free) len = free;
   return av_fifo_generic_write(buffer, data, len, NULL);
 }
@@ -337,7 +337,7 @@
 }
 
 static int get_space(void) {
-  return BUFFSIZE - av_fifo_size(buffer);
+  return av_fifo_space(buffer);
 }
 
 /**
--- a/libao2/ao_sdl.c	Fri Apr 10 13:38:57 2009 +0000
+++ b/libao2/ao_sdl.c	Fri Apr 10 14:41:18 2009 +0000
@@ -67,7 +67,7 @@
 #endif
 
 static int write_buffer(unsigned char* data,int len){
-  int free = BUFFSIZE - av_fifo_size(buffer);
+  int free = av_fifo_space(buffer);
   if (len > free) len = free;
   return av_fifo_generic_write(buffer, data, len, NULL);
 }
@@ -280,7 +280,7 @@
 
 // return: how many bytes can be played without blocking
 static int get_space(void){
-    return BUFFSIZE - av_fifo_size(buffer);
+    return av_fifo_space(buffer);
 }
 
 // plays 'len' bytes of 'data'