aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-10-17 17:39:53 +0000
committerGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:18:37 +0200
commitc640b92bdd2624fba3dbc9fc421391f4739c7c93 (patch)
tree3d8102c531ba8e6751efb77906c4958b864f0d1d
parent56d122a6db2954b5a79c54634fe09b10b888871c (diff)
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
-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) {