X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fvorbis%2Fproducer_vorbis.c;h=46cae760faedd8e5bf4309a3d8c9a0bf5a804541;hb=e727806e894128be3004502eee4d41537fb31c7d;hp=3557cb4feeb6f0e24b03b32094a5780a61ea562c;hpb=94dce1aea965163f8dcd2f97271f2652abb0e62d;p=melted diff --git a/src/modules/vorbis/producer_vorbis.c b/src/modules/vorbis/producer_vorbis.c index 3557cb4..46cae76 100644 --- a/src/modules/vorbis/producer_vorbis.c +++ b/src/modules/vorbis/producer_vorbis.c @@ -203,15 +203,11 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form // Check for audio buffer and create if necessary if ( audio_buffer == NULL ) { - // Release pointer - void *release = NULL; - // Allocate the audio buffer - audio_buffer = mlt_pool_allocate( 131072 * sizeof( int16_t ), &release ); + audio_buffer = mlt_pool_alloc( 131072 * sizeof( int16_t ) ); // And store it on properties for reuse - mlt_properties_set_data( properties, "audio_buffer_release", release, 0, ( mlt_destructor )mlt_pool_release, NULL ); - mlt_properties_set_data( properties, "audio_buffer", audio_buffer, 0, NULL, NULL ); + mlt_properties_set_data( properties, "audio_buffer", audio_buffer, 0, mlt_pool_release, NULL ); } // Seek if necessary @@ -274,13 +270,11 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form // Now handle the audio if we have enough if ( audio_used >= *samples ) { - void *release = NULL; - *buffer = mlt_pool_allocate( *samples * *channels * sizeof( int16_t ), &release ); + *buffer = mlt_pool_alloc( *samples * *channels * sizeof( int16_t ) ); memcpy( *buffer, audio_buffer, *samples * *channels * sizeof( int16_t ) ); audio_used -= *samples; memmove( audio_buffer, &audio_buffer[ *samples * *channels ], audio_used * *channels * sizeof( int16_t ) ); - mlt_properties_set_data( frame_properties, "audio_release", release, 0, ( mlt_destructor )mlt_pool_release, NULL ); - mlt_properties_set_data( frame_properties, "audio", *buffer, 0, NULL, NULL ); + mlt_properties_set_data( frame_properties, "audio", *buffer, 0, mlt_pool_release, NULL ); } else { @@ -333,7 +327,7 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index mlt_frame_set_position( *frame, mlt_producer_position( this ) ); // Set the position of this producer - mlt_properties_set_position( mlt_frame_properties( *frame ), "vorbis_position", mlt_producer_get_in( this ) + mlt_producer_position( this ) ); + mlt_properties_set_position( mlt_frame_properties( *frame ), "vorbis_position", mlt_producer_position( this ) ); // Set up the audio producer_set_up_audio( this, *frame );