From: lilo_booter Date: Tue, 19 Oct 2004 15:32:24 +0000 (+0000) Subject: audio mix and repeated frames X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=52fa2474c1a2472022dd12ccea5c794f66532012;p=melted audio mix and repeated frames git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@484 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 9198807..fe86d67 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -859,7 +859,17 @@ int mlt_frame_mix_audio( mlt_frame this, mlt_frame that, float weight_start, flo //fprintf( stderr, "mix: frame dest samples %d channels %d position %lld\n", samples_dest, channels_dest, mlt_properties_get_position( mlt_frame_properties( this ), "_position" ) ); mlt_frame_get_audio( that, &src, format, &frequency_src, &channels_src, &samples_src ); //fprintf( stderr, "mix: frame src samples %d channels %d\n", samples_src, channels_src ); - + + int silent = mlt_properties_get_int( mlt_frame_properties( this ), "silent_audio" ); + mlt_properties_set_int( mlt_frame_properties( this ), "silent_audio", 0 ); + if ( silent ) + memset( dest, 0, samples_dest * channels_dest * sizeof( int16_t ) ); + + silent = mlt_properties_get_int( mlt_frame_properties( that ), "silent_audio" ); + mlt_properties_set_int( mlt_frame_properties( that ), "silent_audio", 0 ); + if ( silent ) + memset( src, 0, samples_src * channels_src * sizeof( int16_t ) ); + if ( channels_src > 6 ) channels_src = 0; if ( channels_dest > 6 ) diff --git a/src/modules/core/transition_mix.c b/src/modules/core/transition_mix.c index 43e98f0..1f08471 100644 --- a/src/modules/core/transition_mix.c +++ b/src/modules/core/transition_mix.c @@ -106,7 +106,14 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt mlt_properties_set_double( b_props, "audio.reverse", mlt_properties_get_double( properties, "reverse" ) ); } - + + // Ensure that the tractor knows this isn't test audio... + if ( mlt_properties_get_int( mlt_frame_properties( a_frame ), "test_audio" ) ) + { + mlt_properties_set_int( mlt_frame_properties( a_frame ), "test_audio", 0 ); + mlt_properties_set_int( mlt_frame_properties( a_frame ), "silent_audio", 1 ); + } + // Backup the original get_audio (it's still needed) mlt_properties_set_data( mlt_frame_properties( a_frame ), "mix.get_audio", a_frame->get_audio, 0, NULL, NULL );