]> git.sesse.net Git - mlt/commitdiff
Fix multiple workers getting the same frame.
authorDan Dennedy <dan@dennedy.org>
Mon, 18 Oct 2010 01:02:42 +0000 (18:02 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 24 Jan 2011 02:09:44 +0000 (18:09 -0800)
src/framework/mlt_consumer.c

index a78b215c28eff1a7cdbf6e7e61ab298448bde8b9..ff579be32ec0c7a7b74c3fdc3de1b923c0c7fb34 100644 (file)
@@ -831,7 +831,6 @@ static void *consumer_worker_thread( void *arg )
                        pthread_cond_wait( &this->queue_cond, &this->queue_mutex );
                        index = first_unprocessed_frame( this );
                }
-               pthread_mutex_unlock( &this->queue_mutex );
 
                // Mark the frame for processing
                frame = mlt_deque_peek( this->queue, index );
@@ -842,6 +841,7 @@ static void *consumer_worker_thread( void *arg )
                        frame->is_processing = 1;
                        mlt_properties_inc_ref( MLT_FRAME_PROPERTIES( frame ) );
                }
+               pthread_mutex_unlock( &this->queue_mutex );
 
                // If there's no frame, we're probably stopped...
                if ( frame == NULL )