From c640b92bdd2624fba3dbc9fc421391f4739c7c93 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Oct 2010 17:39:53 +0000 Subject: [PATCH] ao_sun: Add support for AOPLAY_FINAL_CHUNK Reportedly this also fixes a possible hang at the end of playback (shouldn't happen unless delay reporting is broken too). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32509 b3059339-0415-0410-9bf9-f77b7e298cf2 Reindent. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32510 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_sun.c | 8 +++++--- 1 file 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) {