rtsp-media: update expected_async_done during suspend
authorLudvig Rappe <ludvigr@axis.com>
Mon, 4 May 2020 11:43:00 +0000 (13:43 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 27 May 2020 15:23:04 +0000 (15:23 +0000)
commit0526a5c9bb07642f8d3bb050835723dc91758292
tree6a8edd9145e2b628a2fa031dc881294188b8ffe1
parentba7d568bb3103840abc086db657564817a73b03d
rtsp-media: update expected_async_done during suspend

Set expected_async_done to FALSE in default_suspend() if a state change
occurs and the return value from set_target_state() is something other
than GST_STATE_CHANGE_ASYNC.

Without this change there is a risk that expected_async_done will be
TRUE even though no asynchronous state change is taking place. This
could happen if the pipeline is set to PAUSED using
media_set_pipeline_state_locked(), an asynchronous state change starts
and then the media is suspended (which could result in a state change,
aborting the asynchronous state change). If the media is suspended
before the asynchronous state change ends then expected_async_done will
be TRUE but no asynchronous state change is taking place.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/123>
gst/rtsp-server/rtsp-media.c