]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_tractor.c
fix memory leak (coverity-709378)
[mlt] / src / framework / mlt_tractor.c
index e509fe2795cdda99c918a03180b75810414c91f9..714b2df5ded7958f76cc1d5916a19004ca4685a3 100644 (file)
@@ -267,11 +267,9 @@ static int producer_get_image( mlt_frame self, uint8_t **buffer, mlt_image_forma
        mlt_properties_set( frame_properties, "rescale.interp", mlt_properties_get( properties, "rescale.interp" ) );
        mlt_properties_set_int( frame_properties, "resize_alpha", mlt_properties_get_int( properties, "resize_alpha" ) );
        mlt_properties_set_int( frame_properties, "distort", mlt_properties_get_int( properties, "distort" ) );
-       mlt_properties_set_double( frame_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
        mlt_properties_set_int( frame_properties, "consumer_deinterlace", mlt_properties_get_int( properties, "consumer_deinterlace" ) );
        mlt_properties_set( frame_properties, "deinterlace_method", mlt_properties_get( properties, "deinterlace_method" ) );
-       mlt_properties_set_int( frame_properties, "normalised_width", mlt_properties_get_int( properties, "normalised_width" ) );
-       mlt_properties_set_int( frame_properties, "normalised_height", mlt_properties_get_int( properties, "normalised_height" ) );
+       mlt_properties_set_int( frame_properties, "consumer_tff", mlt_properties_get_int( properties, "consumer_tff" ) );
        mlt_frame_get_image( frame, buffer, format, width, height, writable );
        mlt_frame_set_image( self, *buffer, 0, NULL );
        mlt_properties_set_int( properties, "width", *width );
@@ -282,6 +280,7 @@ static int producer_get_image( mlt_frame self, uint8_t **buffer, mlt_image_forma
        mlt_properties_set_int( properties, "distort", mlt_properties_get_int( frame_properties, "distort" ) );
        mlt_properties_set_int( properties, "colorspace", mlt_properties_get_int( frame_properties, "colorspace" ) );
        mlt_properties_set_int( properties, "force_full_luma", mlt_properties_get_int( frame_properties, "force_full_luma" ) );
+       mlt_properties_set_int( properties, "top_field_first", mlt_properties_get_int( frame_properties, "top_field_first" ) );
        data = mlt_frame_get_alpha_mask( frame );
        mlt_properties_get_data( frame_properties, "alpha", &size );
        mlt_frame_set_alpha( self, data, size, NULL );
@@ -295,9 +294,10 @@ static int producer_get_audio( mlt_frame self, void **buffer, mlt_audio_format *
        mlt_properties properties = MLT_FRAME_PROPERTIES( self );
        mlt_frame frame = mlt_frame_pop_audio( self );
        mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples );
-       mlt_properties_set_data( properties, "audio", *buffer, 0, NULL, NULL );
-       mlt_properties_set_int( properties, "frequency", *frequency );
-       mlt_properties_set_int( properties, "channels", *channels );
+       mlt_frame_set_audio( self, *buffer, *format, mlt_audio_format_size( *format, *samples, *channels ), NULL );
+       mlt_properties_set_int( properties, "audio_frequency", *frequency );
+       mlt_properties_set_int( properties, "audio_channels", *channels );
+       mlt_properties_set_int( properties, "audio_samples", *samples );
        return 0;
 }
 
@@ -395,14 +395,16 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra
                                temp_properties = MLT_FRAME_PROPERTIES( temp );
 
                                // Pass all unique meta properties from the producer's frame to the new frame
+                               mlt_properties_lock( temp_properties );
                                int props_count = mlt_properties_count( temp_properties );
                                int j;
                                for ( j = 0; j < props_count; j ++ )
                                {
                                        char *name = mlt_properties_get_name( temp_properties, j );
                                        if ( !strncmp( name, "meta.", 5 ) && !mlt_properties_get( frame_properties, name ) )
-                                               mlt_properties_set( frame_properties, name, mlt_properties_get( temp_properties, name ) );
+                                               mlt_properties_set( frame_properties, name, mlt_properties_get_value( temp_properties, j ) );
                                }
+                               mlt_properties_unlock( temp_properties );
 
                                // Copy the format conversion virtual functions
                                if ( ! (*frame)->convert_image && temp->convert_image )
@@ -476,10 +478,6 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra
                                        if ( first_video == NULL )
                                                first_video = temp;
 
-                                       // Ensure that all frames know the aspect ratio of the background
-                                       mlt_properties_set_double( temp_properties, "output_ratio",
-                                                                                          mlt_properties_get_double( MLT_FRAME_PROPERTIES( first_video ), "aspect_ratio" ) );
-
                                        mlt_properties_set_int( MLT_FRAME_PROPERTIES( temp ), "image_count", ++ image_count );
                                        image_count = 1;
                                }
@@ -502,8 +500,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra
                                mlt_properties_set_data( video_properties, "global_queue", data_queue, 0, destroy_data_queue, NULL );
                                mlt_properties_set_int( frame_properties, "width", mlt_properties_get_int( video_properties, "width" ) );
                                mlt_properties_set_int( frame_properties, "height", mlt_properties_get_int( video_properties, "height" ) );
-                               mlt_properties_set_int( frame_properties, "real_width", mlt_properties_get_int( video_properties, "real_width" ) );
-                               mlt_properties_set_int( frame_properties, "real_height", mlt_properties_get_int( video_properties, "real_height" ) );
+                               mlt_properties_pass_list( frame_properties, video_properties, "meta.media.width, meta.media.height" );
                                mlt_properties_set_int( frame_properties, "progressive", mlt_properties_get_int( video_properties, "progressive" ) );
                                mlt_properties_set_double( frame_properties, "aspect_ratio", mlt_properties_get_double( video_properties, "aspect_ratio" ) );
                                mlt_properties_set_int( frame_properties, "image_count", image_count );