From 464ad50e25a788e900b3a0207392a689a87d745e Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Sun, 4 Jan 2009 13:46:08 +0100 Subject: Fix WAV demuxer to send the last frames when they don't fit perfectly into the buffer --- ChangeLog | 2 ++ src/demuxers/demux_wav.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf46add9d..b4ff0b66a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ xine-lib (1.1.16) 2008-??-?? * Fix MMS media requests where the URI contains %-encoded characters. * Fix two hangs related to stopping playback of broken audio streams where no audio data is sent to the output thread. + * Fix WAV demuxer to send the last frames when they don't fit perfectly into + the buffer xine-lib (1.1.15) 2008-08-14 * Security fixes: diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 5fbec7b69..5f39395ad 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -209,11 +209,16 @@ static int demux_wav_send_chunk(demux_plugin_t *this_gen) { buf->size = remaining_sample_bytes; remaining_sample_bytes -= buf->size; - if (this->input->read(this->input, buf->content, buf->size) != + off_t read; + if ((read = this->input->read(this->input, buf->content, buf->size)) != buf->size) { - buf->free_buffer(buf); - this->status = DEMUX_FINISHED; - break; + if (read == 0) { + buf->free_buffer(buf); + this->status = DEMUX_FINISHED; + break; + } else { + buf->size = read; + } } #if 0 -- cgit v1.2.3