[FFmpeg-cvslog] r14707 - trunk/ffmpeg.c

lorenm subversion
Tue Aug 12 07:59:12 CEST 2008


Author: lorenm
Date: Tue Aug 12 07:59:12 2008
New Revision: 14707

Log:
align the audio decoding buffer, since some codecs write to it with simd


Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	(original)
+++ trunk/ffmpeg.c	Tue Aug 12 07:59:12 2008
@@ -1198,8 +1198,11 @@ static int output_packet(AVInputStream *
         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 */




More information about the ffmpeg-cvslog mailing list