/** Get the audio from a frame.
*/
-static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
+static int producer_get_audio( mlt_frame frame, void **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties from the frame
mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Now handle the audio if we have enough
if ( audio_used >= *samples )
{
- *buffer = mlt_pool_alloc( *samples * *channels * sizeof( int16_t ) );
- memcpy( *buffer, audio_buffer, *samples * *channels * sizeof( int16_t ) );
+ int size = *samples * *channels * sizeof( int16_t );
+
+ *format = mlt_audio_s16;
+ *buffer = mlt_pool_alloc( size );
+ memcpy( *buffer, audio_buffer, size );
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, mlt_pool_release, NULL );
+ mlt_frame_set_audio( frame, *buffer, *format, size, mlt_pool_release );
}
else
{