gst-launch: go back down to GST_STATE_NULL in one step.
authorMathieu Duponchelle <mathieu@centricular.com>
Wed, 1 Apr 2020 13:41:49 +0000 (15:41 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Wed, 1 Apr 2020 13:41:49 +0000 (15:41 +0200)
commitc682579c5ecaf6a8cef1c876b3c45548e5bcbb4b
treed9e6438e4b06bc3b95dfcf0f2d5b2a6fb2ff2d36
parente906197c622725e48b6250a71a922d45b006fb14
gst-launch: go back down to GST_STATE_NULL in one step.

Going through each state on the way back down to GST_STATE_NULL
can cause deadlocks, for example:

gst-launch-1.0 audiotestsrc ! valve drop=true ! autoaudiosink

ctrl + C

Hangs forever when going to PAUSED, because the "final" state is
ASYNC, and the sink blocks waiting for a preroll buffer.

Going straight to NULL addresses this issue, and also helps
making teardown faster when piping sparse streams to a
sync sink.
tools/gst-launch.c