From b483d64bc0980ff7f6c6b05083c919fa98435736 Mon Sep 17 00:00:00 2001 From: pacman Date: Wed, 28 Jun 2006 19:22:27 +0000 Subject: Respect AOPLAY_FINAL_CHUNK git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18846 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_oss.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libao2') diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index c67aca5cc5..d6e9598e55 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -495,8 +495,13 @@ static int get_space(void){ // 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; } -- cgit v1.2.3