summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorpacman <pacman@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-06-28 19:22:27 +0000
committerpacman <pacman@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-06-28 19:22:27 +0000
commitb483d64bc0980ff7f6c6b05083c919fa98435736 (patch)
treecfedc041f92106a763dd7ac679eca66aaa015e77 /libao2
parent3d8cdfd839a6ddc7efe82a36ef860373c64b7803 (diff)
downloadmpv-b483d64bc0980ff7f6c6b05083c919fa98435736.tar.bz2
mpv-b483d64bc0980ff7f6c6b05083c919fa98435736.tar.xz
Respect AOPLAY_FINAL_CHUNK
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18846 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_oss.c9
1 files changed, 7 insertions, 2 deletions
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;
}