diff options
author | Matthias Kretz <kretz@kde.org> | 2009-01-04 13:46:08 +0100 |
---|---|---|
committer | Matthias Kretz <kretz@kde.org> | 2009-01-04 13:46:08 +0100 |
commit | 464ad50e25a788e900b3a0207392a689a87d745e (patch) | |
tree | a4670f299beb4dfa586cfe9183cad9ec7d7fa440 | |
parent | 90acd04b32de69512076b386cbb385041697e63e (diff) | |
download | xine-lib-464ad50e25a788e900b3a0207392a689a87d745e.tar.gz xine-lib-464ad50e25a788e900b3a0207392a689a87d745e.tar.bz2 |
Fix WAV demuxer to send the last frames when they don't fit perfectly into the buffer
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/demuxers/demux_wav.c | 13 |
2 files changed, 11 insertions, 4 deletions
@@ -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 |