OpenGL apps need to receive consumer-thread-stopped *after* all of the
frames are closed. Otherwise, it may cleanup the GL context before
frames holding context resources are closed.
Some consumer threads call mlt_consumer_purge().
// Remove the last frame
mlt_frame_close( frame );
// Remove the last frame
mlt_frame_close( frame );
- mlt_events_fire( properties, "consumer-thread-stopped", NULL );
pthread_cond_broadcast( &priv->done_cond );
pthread_mutex_unlock( &priv->done_mutex );
}
pthread_cond_broadcast( &priv->done_cond );
pthread_mutex_unlock( &priv->done_mutex );
}
- mlt_events_fire( properties, "consumer-thread-stopped", NULL );
// Close the queue
mlt_deque_close( priv->queue );
// Close the queue
mlt_deque_close( priv->queue );
+
+ mlt_events_fire( MLT_CONSUMER_PROPERTIES(self), "consumer-thread-stopped", NULL );
// Close the queues
mlt_deque_close( priv->queue );
mlt_deque_close( priv->worker_threads );
// Close the queues
mlt_deque_close( priv->queue );
mlt_deque_close( priv->worker_threads );
+
+ mlt_events_fire( MLT_CONSUMER_PROPERTIES(self), "consumer-thread-stopped", NULL );
pthread_cond_broadcast( &priv->put_cond );
pthread_mutex_unlock( &priv->put_mutex );
pthread_cond_broadcast( &priv->put_cond );
pthread_mutex_unlock( &priv->put_mutex );
- if ( priv->started && priv->real_time )
- pthread_mutex_lock( &priv->queue_mutex );
-
if ( self->purge )
self->purge( self );
if ( self->purge )
self->purge( self );
+ pthread_mutex_lock( &priv->queue_mutex );
while ( priv->started && mlt_deque_count( priv->queue ) )
mlt_frame_close( mlt_deque_pop_back( priv->queue ) );
while ( priv->started && mlt_deque_count( priv->queue ) )
mlt_frame_close( mlt_deque_pop_back( priv->queue ) );
+ pthread_mutex_unlock( &priv->queue_mutex );
+
if ( priv->started && priv->real_time )
{
priv->is_purge = 1;
if ( priv->started && priv->real_time )
{
priv->is_purge = 1;
+ pthread_mutex_lock( &priv->queue_mutex );
pthread_cond_broadcast( &priv->queue_cond );
pthread_mutex_unlock( &priv->queue_mutex );
if ( abs( priv->real_time ) > 1 )
pthread_cond_broadcast( &priv->queue_cond );
pthread_mutex_unlock( &priv->queue_mutex );
if ( abs( priv->real_time ) > 1 )