queue2: fix event/preroll deadlock
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 20 Mar 2014 10:14:33 +0000 (06:14 -0400)
committerWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 11:00:50 +0000 (12:00 +0100)
commita6decb91ac2c035c381d59f1f1fabfeb2f869f95
tree516ea29df98cc70c6ae77f8c375d3d4edd6dd3d1
parent4ab09ee869b81f0fe05c360d738babd22e99c571
queue2: fix event/preroll deadlock

The qlock is released between popping a buffer from the queue
and pushing it. When this buffer causes the sink to wait in
preroll, this lets a query see that the queue is empty, and
push the query then wait for it to be serviced. However, this
will not be done till after peroll, and this will thus block.
If upstream was waiting on buffering to reach 100% before
switching to PLAYING, a deadlock would ensue.

We fix it by refusing the query when buffering, as per Wim's
recommendation on IRC.
plugins/elements/gstqueue2.c