summaryrefslogtreecommitdiffstats
path: root/libao2/ao_sun.c
diff options
context:
space:
mode:
Diffstat (limited to 'libao2/ao_sun.c')
-rw-r--r--libao2/ao_sun.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c
index 02ffa1edb6..10cc87e1b0 100644
--- a/libao2/ao_sun.c
+++ b/libao2/ao_sun.c
@@ -664,9 +664,11 @@ 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){
- if (len < ao_data.outburst) return 0;
- len /= ao_data.outburst;
- len *= ao_data.outburst;
+ if (!(flags & AOPLAY_FINAL_CHUNK)) {
+ len /= ao_data.outburst;
+ len *= ao_data.outburst;
+ }
+ if (len <= 0) return 0;
len = write(audio_fd, data, len);
if(len > 0) {