audio mix and repeated frames
[melted] / src / modules / core / transition_mix.c
index bfc2d5f..1f08471 100644 (file)
@@ -54,7 +54,6 @@ static int transition_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_fo
        }
        //fprintf( stderr, "transition_mix: previous %f current %f\n", mix_start, mix_end );
 
-       mlt_properties_set_int( b_props, "test_audio", mlt_properties_get_int( b_props, "original_test_audio" ) );
        mlt_frame_mix_audio( frame, b_frame, mix_start, mix_end, buffer, format, frequency, channels, samples );
 
        return 0;
@@ -106,10 +105,15 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt
                mlt_properties_set_double( properties, "previous_mix", mlt_properties_get_double( b_props, "audio.mix" ) );
                
                mlt_properties_set_double( b_props, "audio.reverse", mlt_properties_get_double( properties, "reverse" ) );
+       }
 
-               mlt_properties_set_int( b_props, "original_test_audio", mlt_properties_get_int( b_props, "test_audio" ) );
+       // 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 );
 
@@ -132,6 +136,7 @@ mlt_transition transition_mix_init( char *arg )
                this->process = transition_process;
                if ( arg != NULL )
                        mlt_properties_set_double( mlt_transition_properties( this ), "start", atof( arg ) );
+               mlt_properties_set_int( mlt_transition_properties( this ), "_accepts_blanks", 1 );
        }
        return this;
 }