rtsp-media: Fix race codition in finish_unprepare
authorLars Wiréen <larswi@axis.com>
Thu, 27 Dec 2018 10:28:17 +0000 (11:28 +0100)
committerSebastian Dröge <slomo@coaxion.net>
Fri, 25 Jan 2019 12:44:23 +0000 (12:44 +0000)
commitae32203cb09df5c877a8bc68179dbf165715ec52
treeb23332a78a2167030f9835cb6e96b351c1136c6d
parentd5ccb5a7d0fc76460c646811a558c2304ac03f1f
rtsp-media: Fix race codition in finish_unprepare

The previous fix for race condition around finish_unprepare where the
function could be called twice assumed that the status wouldn't change
during execution of the function. This assumption is incorrect as the
state may change, for example if an error message arrives from the
pipeline bus.

Instead a flag keeping track on whether the finish_unprepare function
is currently executing is introduced and checked.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/59
gst/rtsp-server/rtsp-media.c