]> git.sesse.net Git - mlt/blobdiff - src/modules/sdl/consumer_sdl_preview.c
Make mlt_consumer_purge() more thorough. (SF-187)
[mlt] / src / modules / sdl / consumer_sdl_preview.c
index 7e00007e5f0d81cdfe412554838d1d5d195a10e0..9710bdfe12dee8510dd944cef98cc2379c24f8d9 100644 (file)
@@ -59,6 +59,7 @@ struct consumer_sdl_s
 static int consumer_start( mlt_consumer parent );
 static int consumer_stop( mlt_consumer parent );
 static int consumer_is_stopped( mlt_consumer parent );
+static void consumer_purge( mlt_consumer parent );
 static void consumer_close( mlt_consumer parent );
 static void *consumer_thread( void * );
 static void consumer_frame_show_cb( mlt_consumer sdl, mlt_consumer self, mlt_frame frame );
@@ -99,6 +100,7 @@ mlt_consumer consumer_sdl_preview_init( mlt_profile profile, mlt_service_type ty
                parent->start = consumer_start;
                parent->stop = consumer_stop;
                parent->is_stopped = consumer_is_stopped;
+               parent->purge = consumer_purge;
                self->joined = 1;
                mlt_events_listen( MLT_CONSUMER_PROPERTIES( self->play ), self, "consumer-frame-show", ( mlt_listener )consumer_frame_show_cb );
                mlt_events_listen( MLT_CONSUMER_PROPERTIES( self->still ), self, "consumer-frame-show", ( mlt_listener )consumer_frame_show_cb );
@@ -274,6 +276,13 @@ static int consumer_is_stopped( mlt_consumer parent )
        return !self->running;
 }
 
+void consumer_purge( mlt_consumer parent )
+{
+       consumer_sdl self = parent->child;
+       if ( self->running )
+               mlt_consumer_purge( self->play );
+}
+
 static void *consumer_thread( void *arg )
 {
        // Identify the arg