// 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;
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 )
{
}
}
+ this->running = 0;
+
// Kill the video thread
if ( init_video == 0 )
{