|
|
@ -838,7 +838,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
|
|
|
|
if ( audio_buffer == NULL )
|
|
|
|
if ( audio_buffer == NULL )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Allocate the audio buffer
|
|
|
|
// Allocate the audio buffer
|
|
|
|
audio_buffer = mlt_pool_alloc( AVCODEC_MAX_AUDIO_FRAME_SIZE * sizeof( int16_t ) );
|
|
|
|
audio_buffer = mlt_pool_alloc( /*AVCODEC_MAX_AUDIO_FRAME_SIZE*/ 192000 * sizeof( int16_t ) );
|
|
|
|
|
|
|
|
|
|
|
|
// And store it on properties for reuse
|
|
|
|
// And store it on properties for reuse
|
|
|
|
mlt_properties_set_data( properties, "audio_buffer", audio_buffer, 0, ( mlt_destructor )mlt_pool_release, NULL );
|
|
|
|
mlt_properties_set_data( properties, "audio_buffer", audio_buffer, 0, ( mlt_destructor )mlt_pool_release, NULL );
|
|
|
@ -873,7 +873,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
int ret = 0;
|
|
|
|
int got_audio = 0;
|
|
|
|
int got_audio = 0;
|
|
|
|
int16_t *temp = av_malloc( sizeof( int16_t ) * AVCODEC_MAX_AUDIO_FRAME_SIZE );
|
|
|
|
int16_t *temp = av_malloc( sizeof( int16_t ) * /*AVCODEC_MAX_AUDIO_FRAME_SIZE*/ 192000 );
|
|
|
|
|
|
|
|
|
|
|
|
av_init_packet( &pkt );
|
|
|
|
av_init_packet( &pkt );
|
|
|
|
|
|
|
|
|
|
|
@ -895,7 +895,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
|
|
|
|
// We only deal with audio from the selected audio_index
|
|
|
|
// We only deal with audio from the selected audio_index
|
|
|
|
while ( ptr != NULL && ret >= 0 && pkt.stream_index == index && len > 0 )
|
|
|
|
while ( ptr != NULL && ret >= 0 && pkt.stream_index == index && len > 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int data_size = sizeof( int16_t ) * AVCODEC_MAX_AUDIO_FRAME_SIZE;
|
|
|
|
int data_size = sizeof( int16_t ) * /*AVCODEC_MAX_AUDIO_FRAME_SIZE*/ 192000;
|
|
|
|
|
|
|
|
|
|
|
|
// Decode the audio
|
|
|
|
// Decode the audio
|
|
|
|
#if (LIBAVCODEC_VERSION_INT >= ((51<<16)+(29<<8)+0))
|
|
|
|
#if (LIBAVCODEC_VERSION_INT >= ((51<<16)+(29<<8)+0))
|
|
|
|