queue: fix race when flush-stop event comes in whilst shutting down
authorTim-Philipp Müller <tim@centricular.com>
Thu, 21 Aug 2014 13:02:16 +0000 (14:02 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 23 Aug 2014 10:43:20 +0000 (11:43 +0100)
commit93d8679b00c1402aaf44f37bb67487d1a3d0ffc4
tree9e2cc3cc8716124f07c044bae896b37b9709d013
parent86d7a597f00b7e1a6619cf566bfb27adb7f3f8c2
queue: fix race when flush-stop event comes in whilst shutting down

Don't re-start the queue push task on the source pad when a
flush-stop event comes in and we're in the process of shutting
down, otherwise that task will never be stopped again.

When the element is set to READY state, the pads get de-activated.
The source pad gets deactivated before the queue's own activate_mode
function on the source pads gets called (which will stop the thread),
so checking whether the pad is active before re-starting the task on
receiving flush-stop should be fine. The problem would happen when the
flush-stop handler was called just after the queue's activate mode
function had stopped the task.

Spotted and debugged by Linus Svensson <linux.svensson@axis.com>

https://bugzilla.gnome.org/show_bug.cgi?id=734688
plugins/elements/gstqueue.c