wpe: Fix race condition on teardown
authorThibault Saunier <tsaunier@igalia.com>
Wed, 1 Sep 2021 21:35:45 +0000 (17:35 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 3 Sep 2021 15:56:31 +0000 (15:56 +0000)
commitcd3aa029d6b85405b2318be109bacaabe6522d1a
tree67e90d7f6e7ca4804e42eddc1dc1daec6a4495f4
parentf7cbbb5d9a1ff67f94477d8a7f7d4357416ea2e3
wpe: Fix race condition on teardown

There was a race when going to PAUSED while pushing a buffer to the
pipeline process (where we weren't even cancelling anything).

This rework base all the cancellation around the GCancellable
"cancelled" signal trying to ensure that the streaming thread will not
block once a cancel operation happens.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>
ext/wpe/wpe-extension/gstwpeaudiosink.c