Skip to content

Commit

Permalink
Return firing consumer-thread-stopped to the render thread.
Browse files Browse the repository at this point in the history
This is for OpenGL support, where an app event listener expects to
receive this on the rendering thread to which a specific GL context is
bound.
  • Loading branch information
ddennedy committed Dec 31, 2013
1 parent 5783739 commit 60c41cb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/framework/mlt_consumer.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,18 @@ static void *consumer_read_ahead_thread( void *arg )
// Remove the last frame
mlt_frame_close( frame );

// Wipe the queue
pthread_mutex_lock( &priv->queue_mutex );
while ( mlt_deque_count( priv->queue ) )
mlt_frame_close( mlt_deque_pop_back( priv->queue ) );

// Close the queue
mlt_deque_close( priv->queue );
priv->queue = NULL;
pthread_mutex_unlock( &priv->queue_mutex );

mlt_events_fire( MLT_CONSUMER_PROPERTIES(self), "consumer-thread-stopped", NULL );

return NULL;
}

Expand Down Expand Up @@ -1201,15 +1213,6 @@ static void consumer_read_ahead_stop( mlt_consumer self )

// Destroy the condition
pthread_cond_destroy( &priv->queue_cond );

// Wipe the queue
while ( mlt_deque_count( priv->queue ) )
mlt_frame_close( mlt_deque_pop_back( priv->queue ) );

// Close the queue
mlt_deque_close( priv->queue );

mlt_events_fire( MLT_CONSUMER_PROPERTIES(self), "consumer-thread-stopped", NULL );
}
}

Expand Down

0 comments on commit 60c41cb

Please sign in to comment.