fix aspect handling when rescale != none
[melted] / src / modules / vorbis / producer_vorbis.c
index 9d3b849..46cae76 100644 (file)
@@ -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 );