]> git.sesse.net Git - mlt/commitdiff
Fixed crash in slowmotion producer
authorj-b-m <j-b-m@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 31 Mar 2007 09:21:16 +0000 (09:21 +0000)
committerj-b-m <j-b-m@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 31 Mar 2007 09:21:16 +0000 (09:21 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@963 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/core/producer_framebuffer.c

index 5aad353781c994cea308482e4c1e64985d13df24..a017ead7b7dcbc5f82cc97d656a8efecfe77be8e 100644 (file)
@@ -45,21 +45,19 @@ static int framebuffer_get_image( mlt_frame this, uint8_t **image, mlt_image_for
        // Frame properties objects
        mlt_properties frame_properties = MLT_FRAME_PROPERTIES( this );
        mlt_properties first_frame_properties = MLT_FRAME_PROPERTIES( first_frame );
-
+       
        // image stride
-       int size, xstride, ystride;
+       int size;
        switch( *format ){
                case mlt_image_yuv422:
                        size = *width * *height * 2;
-                       xstride = 2;
-                       ystride = 2 * *width;
                        break;
                default:
                        fprintf(stderr, "Unsupported image format\n");
                        return -1;
        }
 
-       uint8_t *output = mlt_properties_get_data( producer_properties, "output_buffer", 0 );
+       uint8_t *output = mlt_properties_get_data( producer_properties, "output_buffer", NULL );
        if( output == NULL )
        {
                output = mlt_pool_alloc( size );
@@ -71,8 +69,8 @@ static int framebuffer_get_image( mlt_frame this, uint8_t **image, mlt_image_for
        uint8_t *first_image = mlt_properties_get_data( first_frame_properties, "image", NULL );
 
        // which frames are buffered?
-
        int error = 0;
+       mlt_properties_set_double( first_frame_properties, "consumer_aspect_ratio", mlt_properties_get_double(frame_properties, "consumer_aspect_ratio"));
 
        if( first_image == NULL )
        {
@@ -83,7 +81,6 @@ static int framebuffer_get_image( mlt_frame this, uint8_t **image, mlt_image_for
                        return error;
                }
        }
-
        // Start with a base image
        memcpy( output, first_image, size );
 
@@ -175,7 +172,6 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
 
                // Give the returned frame temporal identity
                mlt_frame_set_position( *frame, mlt_producer_position( this ) );
-
        }
 
        return 0;