forked from FFmpeg/FFmpeg
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
This commit is contained in:
parent
72745cff20
commit
81b060faf9
1 changed files with 5 additions and 2 deletions
7
ffmpeg.c
7
ffmpeg.c
|
@ -1198,8 +1198,11 @@ static int output_packet(AVInputStream *ist, int ist_index,
|
||||||
if (ist->decoding_needed) {
|
if (ist->decoding_needed) {
|
||||||
switch(ist->st->codec->codec_type) {
|
switch(ist->st->codec->codec_type) {
|
||||||
case CODEC_TYPE_AUDIO:{
|
case CODEC_TYPE_AUDIO:{
|
||||||
if(pkt)
|
if(pkt && samples_size < FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)) {
|
||||||
samples= av_fast_realloc(samples, &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;
|
data_size= samples_size;
|
||||||
/* XXX: could avoid copy if PCM 16 bits with same
|
/* XXX: could avoid copy if PCM 16 bits with same
|
||||||
endianness as CPU */
|
endianness as CPU */
|
||||||
|
|
Loading…
Add table
Reference in a new issue