this->sdl_overlay = NULL;
if ( !mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( parent ), "audio_off" ) )
+ {
+ pthread_mutex_lock( &this->audio_mutex );
+ pthread_cond_broadcast( &this->audio_cond );
+ pthread_mutex_unlock( &this->audio_mutex );
SDL_QuitSubSystem( SDL_INIT_AUDIO );
+ }
if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( parent ), "sdl_started" ) == 0 )
SDL_Quit( );
// 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 )
{