]> git.sesse.net Git - mlt/commitdiff
filter fixes
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 9 Feb 2004 16:48:29 +0000 (16:48 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 9 Feb 2004 16:48:29 +0000 (16:48 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@130 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_filter.c
src/framework/mlt_frame.c

index 0b4b03f690539db3ba4f0a3725edc2684f16b0b1..95dfc5aa8759a1faebc9374eaccbe255135d3524 100644 (file)
@@ -155,12 +155,9 @@ static int filter_get_frame( mlt_service service, mlt_frame_ptr frame, int index
                int ret = mlt_service_get_frame( this->producer, frame, index );
                if ( ret == 0 )
                {
-                       if ( !mlt_frame_is_test_card( *frame ) )
-                       {
-                               mlt_position position = mlt_frame_get_position( *frame );
-                               if ( position >= in && ( out == 0 || position < out ) )
-                                       *frame = filter_process( this, *frame );
-                       }
+                       mlt_position position = mlt_frame_get_position( *frame );
+                       if ( position >= in && ( out == 0 || position < out ) )
+                               *frame = filter_process( this, *frame );
                        return 0;
                }
                else
index ba8621a6e046388bc505dd0f98309046ce60590b..853f9d51cbc51ae345312c990d9eb37f0258b80d 100644 (file)
@@ -182,11 +182,11 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
        }
        else
        {
-               if ( test_card.vfmt != *format )
+               if ( test_card.vfmt != *format || test_card.width != *width || test_card.height != *height || test_card.image == NULL )
                {
                        uint8_t *p;
                        uint8_t *q;
-                       
+
                        test_card.vfmt = *format;
                        test_card.width = *width == 0 ? 720 : *width;
                        test_card.height = *height == 0 ? 576 : *height;
@@ -223,6 +223,21 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
                *width = test_card.width;
                *height = test_card.height;
                *buffer = test_card.image;
+
+               mlt_properties_set_int( properties, "width", *width );
+               mlt_properties_set_int( properties, "height", *height );
+
+               if ( writable )
+               {
+                       uint8_t *copy = malloc( *width * *height * 2 );
+                       memcpy( copy, *buffer, *width * *height * 2 );
+                       mlt_properties_set_data( properties, "image", copy, *width * *height * 2, free, NULL );
+                       *buffer = copy;
+               }
+               else
+               {
+                       mlt_properties_set_data( properties, "image", *buffer, *width * *height * 2, NULL, NULL );
+               }
        }
 
        return 0;