mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
rtsp-server: Unprepare media that is in error state
Without this patch a prepared media that entered an error state remains unprepared. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5621>
This commit is contained in:
parent
d7b5b54eda
commit
bd4a9fde89
1 changed files with 3 additions and 15 deletions
|
@ -5227,10 +5227,11 @@ gst_rtsp_media_set_state (GstRTSPMedia * media, GstState state,
|
|||
gst_rtsp_media_get_status (media);
|
||||
g_rec_mutex_lock (&priv->state_lock);
|
||||
}
|
||||
if (priv->status == GST_RTSP_MEDIA_STATUS_ERROR)
|
||||
if (priv->status == GST_RTSP_MEDIA_STATUS_ERROR && state > GST_STATE_READY)
|
||||
goto error_status;
|
||||
if (priv->status != GST_RTSP_MEDIA_STATUS_PREPARED &&
|
||||
priv->status != GST_RTSP_MEDIA_STATUS_SUSPENDED)
|
||||
priv->status != GST_RTSP_MEDIA_STATUS_SUSPENDED &&
|
||||
priv->status != GST_RTSP_MEDIA_STATUS_ERROR)
|
||||
goto not_prepared;
|
||||
|
||||
/* NULL and READY are the same */
|
||||
|
@ -5329,19 +5330,6 @@ error_status:
|
|||
{
|
||||
GST_WARNING ("media %p in error status while changing to state %d",
|
||||
media, state);
|
||||
if (state == GST_STATE_NULL) {
|
||||
for (i = 0; i < transports->len; i++) {
|
||||
GstRTSPStreamTransport *trans;
|
||||
|
||||
/* we need a non-NULL entry in the array */
|
||||
trans = g_ptr_array_index (transports, i);
|
||||
if (trans == NULL)
|
||||
continue;
|
||||
|
||||
gst_rtsp_stream_transport_set_active (trans, FALSE);
|
||||
}
|
||||
priv->n_active = 0;
|
||||
}
|
||||
g_rec_mutex_unlock (&priv->state_lock);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue