Skip to content
Snippets Groups Projects
Commit 6028d104 authored by Mathieu Duponchelle's avatar Mathieu Duponchelle :frog: Committed by Tim-Philipp Müller
Browse files

rtsp-media: do not unblock on unsuspend

rtsp_media_unsuspend() is called from handle_play_request()
before sending the play response. Unblocking the streams here
was causing data to be sent out before the client was ready
to handle it, with obvious side effects such as initial packets
getting discarded, causing decoding errors.

Instead we can simply let the media streams be unblocked when
the state of the media is set to PLAYING, which occurs after
sending the play response.

Part-of: <gstreamer/gst-rtsp-server!147>
parent 655c78ff
No related branches found
No related tags found
No related merge requests found
Pipeline #207551 canceled
......@@ -4582,21 +4582,14 @@ default_unsuspend (GstRTSPMedia * media)
if (gst_rtsp_media_is_receive_only (media))
break;
if (media_streams_blocking (media)) {
gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARING);
/* at this point the media pipeline has been updated and contain all
* specific transport parts: all active streams contain at least one sink
* element and it's safe to unblock all blocked streams */
media_streams_set_blocked (media, FALSE);
} else {
/* streams are not blocked and media is suspended from PAUSED */
gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED);
}
g_rec_mutex_unlock (&priv->state_lock);
if (gst_rtsp_media_get_status (media) == GST_RTSP_MEDIA_STATUS_ERROR) {
g_rec_mutex_unlock (&priv->state_lock);
if (gst_rtsp_media_get_status (media) == GST_RTSP_MEDIA_STATUS_ERROR) {
g_rec_mutex_lock (&priv->state_lock);
goto preroll_failed;
}
g_rec_mutex_lock (&priv->state_lock);
goto preroll_failed;
}
g_rec_mutex_lock (&priv->state_lock);
gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED);
break;
case GST_RTSP_SUSPEND_MODE_PAUSE:
gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment