From 8a0b59985f74e39f6fe8d563bb770147e9e07f3b Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Mon, 22 Feb 2010 22:13:05 -0800 Subject: [PATCH] Fix video glitches when switching still and normal sdl consumers. --- configure | 2 +- src/modules/sdl/consumer_sdl_preview.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c8b0f861..2a495c5b 100755 --- 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() diff --git a/src/modules/sdl/consumer_sdl_preview.c b/src/modules/sdl/consumer_sdl_preview.c index e43ac24d..ba286657 100644 --- a/src/modules/sdl/consumer_sdl_preview.c +++ b/src/modules/sdl/consumer_sdl_preview.c @@ -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 -- 2.39.2