X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;fp=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;h=5879187205342eeeff77f9f88f256d2bda7d4afd;hb=bd2707bb370eda9cae39e22b5e89b9096474cd7d;hp=bcd69a04c1f3ac361720b5d844c755e52be2929a;hpb=6cecd621e22006489bd1e351f4cdad13daf0dc4a;p=melted diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index bcd69a0..5879187 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -683,6 +683,10 @@ static void *consumer_thread( void *arg ) // Get the consumer mlt_consumer consumer = &this->parent; + // Convenience functionality + int terminate_on_pause = mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "terminate_on_pause" ); + int terminated = 0; + // Video thread pthread_t thread; @@ -696,11 +700,15 @@ static void *consumer_thread( void *arg ) struct timespec tm = { 0, 100000 }; // Loop until told not to - while( this->running ) + while( !terminated && this->running ) { // Get a frame from the attached producer frame = mlt_consumer_rt_frame( consumer ); + // Check for termination + if ( terminate_on_pause && frame != NULL ) + terminated = mlt_properties_get_double( MLT_FRAME_PROPERTIES( frame ), "_speed" ) == 0.0; + // Ensure that we have a frame if ( frame != NULL ) { @@ -737,6 +745,8 @@ static void *consumer_thread( void *arg ) } } + this->running = 0; + // Kill the video thread if ( init_video == 0 ) {