aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2008-08-12 05:59:12 +0000
committerLoren Merritt <lorenm@u.washington.edu>2008-08-12 05:59:12 +0000
commit81b060faf98d3ef3ab009220ba8a725a31ff047f (patch)
treec31f32fe46c53eb840d14136725642211eab81da /ffmpeg.c
parent72745cff20a07f5544e7d2de51d792c7bd21f07f (diff)
downloadffmpeg-81b060faf98d3ef3ab009220ba8a725a31ff047f.tar.gz
align the audio decoding buffer, since some codecs write to it with simd
Originally committed as revision 14707 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 850778db91..53009d395f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1198,8 +1198,11 @@ static int output_packet(AVInputStream *ist, int ist_index,
if (ist->decoding_needed) {
switch(ist->st->codec->codec_type) {
case CODEC_TYPE_AUDIO:{
- if(pkt)
- samples= av_fast_realloc(samples, &samples_size, FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE));
+ if(pkt && samples_size < FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)) {
+ samples_size = FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE);
+ av_free(samples);
+ samples= av_malloc(samples_size);
+ }
data_size= samples_size;
/* XXX: could avoid copy if PCM 16 bits with same
endianness as CPU */