]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_consumer.c
Some fixes for alpha masks
[mlt] / src / framework / mlt_consumer.c
index 6074655b24a759396d57f6d20a15f1f1d5413257..4422b111389c7ac95f5120ff5d7c9b9d7005934c 100644 (file)
@@ -28,6 +28,8 @@
 #include <stdlib.h>
 #include <sys/time.h>
 
+static void mlt_consumer_frame_show( mlt_listener listener, mlt_properties owner, mlt_service this, void **args );
+
 /** Public final methods
 */
 
@@ -84,11 +86,18 @@ int mlt_consumer_init( mlt_consumer this, void *child )
                // Hmm - default all consumers to yuv422 :-/
                this->format = mlt_image_yuv422;
 
+               mlt_events_register( properties, "consumer-frame-show", ( mlt_transmitter )mlt_consumer_frame_show );
                mlt_events_register( properties, "consumer-stopped", NULL );
        }
        return error;
 }
 
+static void mlt_consumer_frame_show( mlt_listener listener, mlt_properties owner, mlt_service this, void **args )
+{
+       if ( listener != NULL )
+               listener( owner, this, ( mlt_frame )args[ 0 ] );
+}
+
 /** Create a new consumer.
 */
 
@@ -211,8 +220,8 @@ mlt_frame mlt_consumer_get_frame( mlt_consumer this )
 
                // Aspect ratio and other jiggery pokery
                mlt_properties_set_double( frame_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "aspect_ratio" ) );
-               mlt_properties_set_int( frame_properties, "consumer_progressive", mlt_properties_get_int( properties, "progressive" ) );
-               mlt_properties_set_int( frame_properties, "consumer_deinterlace", mlt_properties_get_int( properties, "deinterlace" ) );
+               if ( mlt_properties_get_int( properties, "progressive" ) || mlt_properties_get_int( properties, "deinterlace" ) )
+                       mlt_properties_set_int( properties, "consumer_deinterlace", 1 );
        }
 
        // Return the frame