diff options
Diffstat (limited to 'libao2/ao_sdl.c')
-rw-r--r-- | libao2/ao_sdl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c index 115eef130b..7749b51946 100644 --- a/libao2/ao_sdl.c +++ b/libao2/ao_sdl.c @@ -66,12 +66,13 @@ static int write_buffer(unsigned char* data,int len){ x=BUFFSIZE-buf_write_pos; if(x>len) x=len; memcpy(buffer[buf_write]+buf_write_pos,data+len2,x); + if (buf_write_pos==0) + ++full_buffers; len2+=x; len-=x; buffered_bytes+=x; buf_write_pos+=x; if(buf_write_pos>=BUFFSIZE){ // block is full, find next! buf_write=(buf_write+1)%NUM_BUFS; - ++full_buffers; buf_write_pos=0; } } @@ -316,6 +317,7 @@ static int get_space(){ // return: number of bytes played static int play(void* data,int len,int flags){ + len = (len/ao_data.outburst)*ao_data.outburst; #if 0 int ret; |