]> git.sesse.net Git - mlt/commitdiff
audio mix and repeated frames
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 19 Oct 2004 15:32:24 +0000 (15:32 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 19 Oct 2004 15:32:24 +0000 (15:32 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@484 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_frame.c
src/modules/core/transition_mix.c

index 9198807de5df91392d53913dc38857dfcf8cf05c..fe86d675d0d5f36b82733ed10001740111882332 100644 (file)
@@ -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 )
index 43e98f0cbb7ea11ca6f4854d825c653ee30051ae..1f084719991a9d3bc8243987b3c29ef329658403 100644 (file)
@@ -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 );