Added ref_count method to properties; temporary work around for test card; titles...
[melted] / src / framework / mlt_frame.c
index 9198807..ff92fbf 100644 (file)
@@ -53,7 +53,7 @@ mlt_frame mlt_frame_init( )
                        mlt_properties_set_int( properties, "height", 576 );
                        mlt_properties_set_int( properties, "normalised_width", 720 );
                        mlt_properties_set_int( properties, "normalised_height", 576 );
-                       mlt_properties_set_double( properties, "aspect_ratio", 72.0/79.0 );
+                       mlt_properties_set_double( properties, "aspect_ratio", 59.0/54.0 );
                }
                else
                {
@@ -61,7 +61,7 @@ mlt_frame mlt_frame_init( )
                        mlt_properties_set_int( properties, "height", 480 );
                        mlt_properties_set_int( properties, "normalised_width", 720 );
                        mlt_properties_set_int( properties, "normalised_height", 480 );
-                       mlt_properties_set_double( properties, "aspect_ratio", 128.0/117.0 );
+                       mlt_properties_set_double( properties, "aspect_ratio", 10.0/11.0 );
                }
 
                mlt_properties_set_data( properties, "audio", NULL, 0, NULL, NULL );
@@ -120,7 +120,8 @@ int mlt_frame_set_aspect_ratio( mlt_frame this, double value )
 
 mlt_position mlt_frame_get_position( mlt_frame this )
 {
-       return mlt_properties_get_position( mlt_frame_properties( this ), "_position" );
+       int pos = mlt_properties_get_position( mlt_frame_properties( this ), "_position" );
+       return pos < 0 ? 0 : pos;
 }
 
 /** Set the position of this frame.
@@ -859,7 +860,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 )