rtsp-media: Only unprepare a media if it was not already unpreparing anyway

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1083>
This commit is contained in:
Sebastian Dröge 2021-10-06 18:19:29 +03:00 committed by GStreamer Marge Bot
parent f0c3eefefc
commit e9d551b45c

View file

@ -4101,6 +4101,8 @@ gst_rtsp_media_unprepare (GstRTSPMedia * media)
priv->prepare_count--;
if (priv->prepare_count > 0)
goto is_busy;
if (priv->status == GST_RTSP_MEDIA_STATUS_UNPREPARING)
goto is_unpreparing;
GST_INFO ("unprepare media %p", media);
set_target_state (media, GST_STATE_NULL, FALSE);
@ -4126,6 +4128,12 @@ was_unprepared:
GST_INFO ("media %p was already unprepared", media);
return TRUE;
}
is_unpreparing:
{
g_rec_mutex_unlock (&priv->state_lock);
GST_INFO ("media %p is already unpreparing", media);
return TRUE;
}
is_busy:
{
GST_INFO ("media %p still prepared %d times", media, priv->prepare_count);