queue2: fix event/preroll deadlock differently
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 16 Apr 2014 14:17:04 +0000 (15:17 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 16 Apr 2014 14:17:04 +0000 (15:17 +0100)
commitf3dd7937a255461afd78fed8e7645d8976b559da
tree6c965dd67979f59af0c0e63694f69806b458e736
parent145517aa6423cf34bd0769f6ccb8c1fad49768ac
queue2: fix event/preroll deadlock differently

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.

This had been fixed recently by failing queries when the
queue2 was buffering, but this happens to break some other
case (playbin on a local http server and matroska), while
this patch works for both.

See https://bugzilla.gnome.org/show_bug.cgi?id=728345
plugins/elements/gstqueue2.c
plugins/elements/gstqueue2.h