# HG changeset patch # User pacman # Date 1151522547 0 # Node ID 518282cbf2386c1e902e38358a24bc3c52c7da89 # Parent 3f59edf39ea25b34ba63726c81cc920a5d1b6e8b Respect AOPLAY_FINAL_CHUNK diff -r 3f59edf39ea2 -r 518282cbf238 libao2/ao_oss.c --- a/libao2/ao_oss.c Wed Jun 28 17:03:16 2006 +0000 +++ b/libao2/ao_oss.c Wed Jun 28 19:22:27 2006 +0000 @@ -495,8 +495,13 @@ // it should round it down to outburst*n // return: number of bytes played static int play(void* data,int len,int flags){ - len/=ao_data.outburst; - len=write(audio_fd,data,len*ao_data.outburst); + if(len==0) + return len; + if(len>ao_data.outburst || !(flags & AOPLAY_FINAL_CHUNK)) { + len/=ao_data.outburst; + len*=ao_data.outburst; + } + len=write(audio_fd,data,len); return len; }