]> git.sesse.net Git - mlt/commit
Use a single queue for parallel workers.
authorDan Dennedy <dan@dennedy.org>
Tue, 5 Oct 2010 03:39:17 +0000 (20:39 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 24 Jan 2011 02:09:44 +0000 (18:09 -0800)
commit5a699a6fb90e0b5e0f0d93daff8b818ad4120803
tree3aae7043883c9ef16873862ba1c2a36e2223d949
parent560e942d10fed29726719feac21d5fc157f92c40
Use a single queue for parallel workers.

This is a major change from the previous model of moving work items
(frames) from one queue to another. This new model improves the behavior
of realtime mode and performance overall. In the new model, a single
queue is used along with an is_processed flag on the frame. Also, there
is an index into the queue (process_head) that indicates from which
point should a worker consider fetching the next unprocessed frame.

There are situations in realtime mode where the processing of a frame
takes longer than the queue (or from head to its fetch index). Over
extended periods of this heavy processing, the video frame in the
consumer may never be updated (rendered=1)! To remedy this, the consumer
detects this and automatically moves the process_head towards the tail,
but even this may not be good enough. The only real remedy is to
increase buffers and suffer with poor latency. If lower latency is
preferred, then it may be better to not use realtime mode and permit
audio discontinuity.
src/framework/mlt_consumer.c
src/framework/mlt_consumer.h
src/framework/mlt_frame.h