]> git.sesse.net Git - mlt/commitdiff
Fix video glitches when switching still and normal sdl consumers.
authorDan Dennedy <dan@dennedy.org>
Tue, 23 Feb 2010 06:13:05 +0000 (22:13 -0800)
committerDan Dennedy <dan@dennedy.org>
Tue, 23 Feb 2010 06:13:05 +0000 (22:13 -0800)
configure
src/modules/sdl/consumer_sdl_preview.c

index c8b0f861ca889dc89d163d45c140de28ae11d9a0..2a495c5b4350f6447cc9398468a6ae45eeaecd6e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-export version=0.5.0
+export version=0.5.1
 export soversion=2
 
 show_help()
index e43ac24d5a45ffc4fc695d0e71a90e3687ac9a4c..ba2866573d60da6f910f8f54bfa99fe19b22e3fe 100644 (file)
@@ -44,6 +44,7 @@ struct consumer_sdl_s
        int running;
        int sdl_flags;
        double last_speed;
+       mlt_position last_position;
 
        pthread_cond_t refresh_cond;
        pthread_mutex_t refresh_mutex;
@@ -112,6 +113,7 @@ void consumer_frame_show_cb( mlt_consumer sdl, mlt_consumer parent, mlt_frame fr
 {
        consumer_sdl this = parent->child;
        this->last_speed = mlt_properties_get_double( MLT_FRAME_PROPERTIES( frame ), "_speed" );
+       this->last_position = mlt_frame_get_position( frame );
        mlt_events_fire( MLT_CONSUMER_PROPERTIES( parent ), "consumer-frame-show", frame, NULL );
 }
 
@@ -345,12 +347,19 @@ static void *consumer_thread( void *arg )
                                        mlt_consumer_stop( this->play );
                                if ( mlt_consumer_is_stopped( this->still ) )
                                {
+                                       mlt_producer producer = mlt_service_get_producer( MLT_CONSUMER_SERVICE( consumer ) );
+                                       if ( producer )
+                                               mlt_producer_seek( producer, this->last_position );
                                        this->last_speed = speed;
                                        this->active = this->still;
                                        this->ignore_change = 0;
                                        mlt_consumer_start( this->still );
+                                       mlt_frame_close( frame );
+                               }
+                               else
+                               {
+                                       mlt_consumer_put_frame( this->still, frame );
                                }
-                               mlt_consumer_put_frame( this->still, frame );
                        }
                        // Otherwise use the normal player
                        else