]> git.sesse.net Git - mlt/commitdiff
Fix crash when connecting the sdl_preview to a new producer.
authorDan Dennedy <dan@dennedy.org>
Sun, 12 Dec 2010 19:47:32 +0000 (11:47 -0800)
committerDan Dennedy <dan@dennedy.org>
Sun, 12 Dec 2010 19:47:32 +0000 (11:47 -0800)
This occurs when you do not first stop the consumer.

src/modules/sdl/consumer_sdl_preview.c

index 73df2e5964deb9423ec0980f0d52adfafb5ef8fe..a2eb510091cd88620b1226c17816ac2ad483864f 100644 (file)
@@ -274,9 +274,8 @@ static void *consumer_thread( void *arg )
        // Identify the arg
        consumer_sdl this = arg;
 
-       // Get the consumer and producer
+       // Get the consumer
        mlt_consumer consumer = &this->parent;
-       mlt_producer producer = MLT_PRODUCER( mlt_service_get_producer( MLT_CONSUMER_SERVICE( consumer ) ) );
 
        // Get the properties
        mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
@@ -341,6 +340,7 @@ static void *consumer_thread( void *arg )
                        // If we aren't playing normally, then use the still
                        if ( speed != 1 )
                        {
+                               mlt_producer producer = MLT_PRODUCER( mlt_service_get_producer( MLT_CONSUMER_SERVICE( consumer ) ) );
                                mlt_position duration = mlt_producer_get_playtime( producer );
                                int pause = 0;