Guest User

Untitled

a guest
Jun 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
  2. index a4a5436..c78ba6a 100644
  3. --- a/modules/codec/avcodec/audio.c
  4. +++ b/modules/codec/avcodec/audio.c
  5. @@ -197,7 +197,7 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
  6. if( p_sys->i_output_max < AVCODEC_MAX_AUDIO_FRAME_SIZE )
  7. p_sys->i_output_max = AVCODEC_MAX_AUDIO_FRAME_SIZE;
  8. msg_Dbg( p_dec, "Using %d bytes output buffer", p_sys->i_output_max );
  9. - p_sys->p_output = malloc( p_sys->i_output_max );
  10. + p_sys->p_output = malloc( p_sys->i_output_max + 15);
  11.  
  12. p_sys->p_samples = NULL;
  13. p_sys->i_samples = 0;
  14. @@ -300,7 +300,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
  15. if( i_output > p_sys->i_output_max )
  16. {
  17. /* Grow output buffer if necessary (eg. for PCM data) */
  18. - p_sys->p_output = realloc( p_sys->p_output, i_output );
  19. + p_sys->p_output = realloc( p_sys->p_output, i_output + 15);
  20. }
  21.  
  22. *pp_block = p_block = block_Realloc( p_block, 0, p_block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE );
  23. @@ -311,11 +311,11 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
  24.  
  25. #if LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
  26. i_used = avcodec_decode_audio2( p_sys->p_context,
  27. - (int16_t*)p_sys->p_output, &i_output,
  28. + (int16_t*)p_sys->p_output & ~15, &i_output,
  29. p_block->p_buffer, p_block->i_buffer );
  30. #else
  31. i_used = avcodec_decode_audio( p_sys->p_context,
  32. - (int16_t*)p_sys->p_output, &i_output,
  33. + (int16_t*)p_sys->p_output & ~15, &i_output,
  34. p_block->p_buffer, p_block->i_buffer );
  35. #endif
  36.  
  37. @@ -363,12 +363,12 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
  38.  
  39. /* **** Now we can output these samples **** */
  40. p_sys->i_samples = i_output / (p_dec->fmt_out.audio.i_bitspersample / 8) / p_sys->p_context->channels;
  41. - p_sys->p_samples = p_sys->p_output;
  42. + p_sys->p_samples = p_sys->p_output & ~15;
  43.  
  44. /* Silent unwanted samples */
  45. if( p_sys->i_reject_count > 0 )
  46. {
  47. - memset( p_sys->p_output, 0, i_output );
  48. + memset( p_sys->p_output & ~15, 0, i_output );
  49. p_sys->i_reject_count--;
  50. }
  51.  
  52. diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
Add Comment
Please, Sign In to add comment