inputselector: Avoid deadlock when shutting down
authorVivia Nikolaidou <vivia@ahiru.eu>
Thu, 2 Mar 2023 13:51:08 +0000 (15:51 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 2 Mar 2023 15:42:15 +0000 (15:42 +0000)
commitd6e3a5da3ca3cffef222e5eeb40f2751c2933eac
tree2a6e701141d928c02f4863bd01094fc162c2d868
parente66d636fd1e7b2a9fbebb5c05767215666f66d00
inputselector: Avoid deadlock when shutting down

Transition from PLAYING to PAUSED unschedules any pending clock wait,
but there was no guard that prevented another input buffer then waiting
again while in PAUSED before dataflow stops. Use a new `playing` flag to
avoid this, and exit the chain function if instead of playing we're now
flushing. Basically the same as the clocksync element.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1772

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4099>
subprojects/gstreamer/plugins/elements/gstinputselector.c
subprojects/gstreamer/plugins/elements/gstinputselector.h