X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fvorbis%2Fproducer_vorbis.c;h=e7dd3669327b3c432a3c94ace9611088110f80d8;hb=573fbdb1b3725394755ef2c0857c200d18974ee1;hp=76671a2730d4334c3dc1ca65da5f0c4edaba0c40;hpb=f00476101550ec7d8e863f6516aa83bc1b524570;p=melted diff --git a/src/modules/vorbis/producer_vorbis.c b/src/modules/vorbis/producer_vorbis.c index 76671a2..e7dd366 100644 --- a/src/modules/vorbis/producer_vorbis.c +++ b/src/modules/vorbis/producer_vorbis.c @@ -171,7 +171,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form mlt_position position = mlt_properties_get_position( frame_properties, "vorbis_position" ); // Get the producer - mlt_producer this = mlt_properties_get_data( frame_properties, "vorbis_producer", NULL ); + mlt_producer this = mlt_frame_pop_audio( frame ); // Get the producer properties mlt_properties properties = MLT_PRODUCER_PROPERTIES( this ); @@ -278,7 +278,6 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form } else { - frame->get_audio = NULL; mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples ); audio_used = 0; } @@ -289,7 +288,6 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form else { // Get silence and don't touch the context - frame->get_audio = NULL; *samples = mlt_sample_calculator( fps, *frequency, position ); mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples ); } @@ -300,21 +298,6 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form return 0; } -/** Set up audio handling. -*/ - -static void producer_set_up_audio( mlt_producer this, mlt_frame frame ) -{ - // Get the properties - mlt_properties properties = MLT_FRAME_PROPERTIES( frame ); - - // Set the audio method - frame->get_audio = producer_get_audio; - - // Set the producer on the frame - mlt_properties_set_data( properties, "vorbis_producer", this, 0, NULL, NULL ); -} - /** Our get frame implementation. */ @@ -327,10 +310,11 @@ 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_position( this ) ); + mlt_properties_set_position( MLT_FRAME_PROPERTIES( *frame ), "vorbis_position", mlt_producer_frame( this ) ); // Set up the audio - producer_set_up_audio( this, *frame ); + mlt_frame_push_audio( *frame, this ); + mlt_frame_push_audio( *frame, producer_get_audio ); // Calculate the next timecode mlt_producer_prepare_next( this );