splitmuxsink: Prevent hang going back to NULL after failures
authorJan Schmidt <jan@centricular.com>
Wed, 7 Jul 2021 14:12:52 +0000 (00:12 +1000)
committerJan Schmidt <jan@centricular.com>
Mon, 26 Jul 2021 06:22:23 +0000 (16:22 +1000)
commitb50d3b9c9fa93af1dcf5162b3b2424209659c2bf
treea90f103c9986d2e7474bdaa068899924ed6baf1f
parent2c85fd1be94c1f3f03294beaf750d45bc9418f6c
splitmuxsink: Prevent hang going back to NULL after failures

Prevent a condition where splitmuxsink won't go back to NULL state
after a child element fails to change state by making sure that
a READY->READY state change doesn't fail, and by returning
GST_FLOW_ERROR or GST_FLOW_FLUSHING upstream to shut down streaming
as quickly as possible.

This can happen after (for example) setting an invalid filename
on the sink element. In that case, the READY->PAUSED transition
fails, but with internal elements still in the NULL state. Trying
to set splitmuxsink back to NULL then ends up trying to bring
those NULL elements up to READY with a READY->READY transition,
(which fails, prevent splitmuxsink from getting to NULL)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1023>
gst/multifile/gstsplitmuxsink.c
tests/check/elements/splitmuxsink.c