Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
- index a4a5436..c78ba6a 100644
- --- a/modules/codec/avcodec/audio.c
- +++ b/modules/codec/avcodec/audio.c
- @@ -197,7 +197,7 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
- if( p_sys->i_output_max < AVCODEC_MAX_AUDIO_FRAME_SIZE )
- p_sys->i_output_max = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- msg_Dbg( p_dec, "Using %d bytes output buffer", p_sys->i_output_max );
- - p_sys->p_output = malloc( p_sys->i_output_max );
- + p_sys->p_output = malloc( p_sys->i_output_max + 15);
- p_sys->p_samples = NULL;
- p_sys->i_samples = 0;
- @@ -300,7 +300,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
- if( i_output > p_sys->i_output_max )
- {
- /* Grow output buffer if necessary (eg. for PCM data) */
- - p_sys->p_output = realloc( p_sys->p_output, i_output );
- + p_sys->p_output = realloc( p_sys->p_output, i_output + 15);
- }
- *pp_block = p_block = block_Realloc( p_block, 0, p_block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE );
- @@ -311,11 +311,11 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
- #if LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
- i_used = avcodec_decode_audio2( p_sys->p_context,
- - (int16_t*)p_sys->p_output, &i_output,
- + (int16_t*)p_sys->p_output & ~15, &i_output,
- p_block->p_buffer, p_block->i_buffer );
- #else
- i_used = avcodec_decode_audio( p_sys->p_context,
- - (int16_t*)p_sys->p_output, &i_output,
- + (int16_t*)p_sys->p_output & ~15, &i_output,
- p_block->p_buffer, p_block->i_buffer );
- #endif
- @@ -363,12 +363,12 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
- /* **** Now we can output these samples **** */
- p_sys->i_samples = i_output / (p_dec->fmt_out.audio.i_bitspersample / 8) / p_sys->p_context->channels;
- - p_sys->p_samples = p_sys->p_output;
- + p_sys->p_samples = p_sys->p_output & ~15;
- /* Silent unwanted samples */
- if( p_sys->i_reject_count > 0 )
- {
- - memset( p_sys->p_output, 0, i_output );
- + memset( p_sys->p_output & ~15, 0, i_output );
- p_sys->i_reject_count--;
- }
- diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
Add Comment
Please, Sign In to add comment