]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_consumer.c
Add a reference to the consumer on the frame.
[mlt] / src / framework / mlt_consumer.c
index 87ba312099b093d45230c0eb1ff338dc80104fc3..8ae3968029f19ddec695244191e2f85c598dcc52 100644 (file)
@@ -807,6 +807,9 @@ static void *consumer_read_ahead_thread( void *arg )
                        continue;
                pos = mlt_frame_get_position( frame );
 
+               // WebVfx uses this to setup a consumer-stopping event handler.
+               mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), "consumer", self, 0, NULL, NULL );
+
                // Increment the counter used for averaging processing cost
                count ++;
 
@@ -1001,6 +1004,9 @@ static void *consumer_worker_thread( void *arg )
                if ( frame == NULL )
                        continue;
 
+               // WebVfx uses this to setup a consumer-stopping event handler.
+               mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), "consumer", self, 0, NULL, NULL );
+
 #ifdef DEINTERLACE_ON_NOT_NORMAL_SPEED
                // All non normal playback frames should be shown
                if ( mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "_speed" ) != 1 )
@@ -1514,7 +1520,12 @@ mlt_frame mlt_consumer_rt_frame( mlt_consumer self )
 
                // This isn't true, but from the consumers perspective it is
                if ( frame != NULL )
+               {
                        mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 1 );
+
+                       // WebVfx uses this to setup a consumer-stopping event handler.
+                       mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), "consumer", self, 0, NULL, NULL );
+               }
        }
 
        return frame;