# HG changeset patch # User reimar # Date 1287337193 0 # Node ID 4a3bfd196e17289352e1c53ee9c22231e0c4c01e # Parent 01115062cb22b96a897ce407d3b042440396e56d Add support for AOPLAY_FINAL_CHUNK, reportedly also fixes a possible hang at the end of playback. diff -r 01115062cb22 -r 4a3bfd196e17 libao2/ao_sun.c --- a/libao2/ao_sun.c Sun Oct 17 16:10:17 2010 +0000 +++ b/libao2/ao_sun.c Sun Oct 17 17:39:53 2010 +0000 @@ -665,9 +665,11 @@ // 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; + 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) {