X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fvorbis%2Fproducer_vorbis.c;h=46cae760faedd8e5bf4309a3d8c9a0bf5a804541;hb=b917ae819659606f59b3ae761d06ab2095ade658;hp=9d3b849cf0a8c0fd369759f6c4f86b9430ad0f18;hpb=e119b618924284bb2bcc7c2199ab06066ed76c8e;p=melted diff --git a/src/modules/vorbis/producer_vorbis.c b/src/modules/vorbis/producer_vorbis.c index 9d3b849..46cae76 100644 --- a/src/modules/vorbis/producer_vorbis.c +++ b/src/modules/vorbis/producer_vorbis.c @@ -204,10 +204,10 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form if ( audio_buffer == NULL ) { // Allocate the audio buffer - audio_buffer = malloc( 131072 * sizeof( int16_t ) ); + audio_buffer = mlt_pool_alloc( 131072 * sizeof( int16_t ) ); // And store it on properties for reuse - mlt_properties_set_data( properties, "audio_buffer", audio_buffer, 0, free, NULL ); + mlt_properties_set_data( properties, "audio_buffer", audio_buffer, 0, mlt_pool_release, NULL ); } // Seek if necessary @@ -270,11 +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 ) { - *buffer = malloc( *samples * *channels * sizeof( int16_t ) ); + *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", *buffer, 0, free, NULL ); + mlt_properties_set_data( frame_properties, "audio", *buffer, 0, mlt_pool_release, NULL ); } else { @@ -327,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 );