diff options
author | Chris Rankin <rankincj@yahoo.com> | 2011-09-10 21:13:57 +0100 |
---|---|---|
committer | Chris Rankin <rankincj@yahoo.com> | 2011-09-10 21:13:57 +0100 |
commit | 7f5d3fdfb80831aad2949e8975f70d35b4c0752e (patch) | |
tree | 46cda9cc6ce179ba323a21234fa2ebe0fbc0b7e8 | |
parent | 72d45226cc4b327d61c620cf3c5c8c22e23c9e1f (diff) | |
download | xine-lib-7f5d3fdfb80831aad2949e8975f70d35b4c0752e.tar.gz xine-lib-7f5d3fdfb80831aad2949e8975f70d35b4c0752e.tar.bz2 |
Pad end of audio data buffer with zeros, as instructed by the API documentation.
-rw-r--r-- | src/combined/ffmpeg/ff_audio_decoder.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c index 68380c124..321d0e8f4 100644 --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -115,7 +115,7 @@ static void *realloc16 (void *m, size_t s) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"), this->bufsize); - this->buf = realloc16 (this->buf, this->bufsize); + this->buf = realloc16 (this->buf, this->bufsize + FF_INPUT_BUFFER_PADDING_SIZE); } } @@ -355,6 +355,10 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */ offset = 0; + + /* pad input data */ + memset(&this->buf[this->size], 0, FF_INPUT_BUFFER_PADDING_SIZE); + while (this->size>0) { decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; #if AVAUDIO > 2 |