if ( !this->running )
{
+ pthread_attr_t thread_attributes;
+
this->running = 1;
- pthread_create( &this->thread, NULL, consumer_thread, this );
+
+ // Allow the user to force resizing to window size
+ if ( mlt_properties_get_int( this->properties, "resize" ) )
+ {
+ mlt_properties_set_int( this->properties, "width", this->width );
+ mlt_properties_set_int( this->properties, "height", this->height );
+ }
+
+ // Inherit the scheduling priority
+ pthread_attr_init( &thread_attributes );
+ pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
+
+ pthread_create( &this->thread, &thread_attributes, consumer_thread, this );
}
return 0;
// Stop the consumer
mlt_consumer_stop( parent );
+ // Close the queue
+ mlt_deque_close( this->queue );
+
// Destroy mutexes
pthread_mutex_destroy( &this->audio_mutex );
pthread_cond_destroy( &this->audio_cond );