Commit 883ddc72 authored by Mathieu Duponchelle's avatar Mathieu Duponchelle 🐸 Committed by GStreamer Marge Bot
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: <!147>
parent 17edff49
Pipeline #199667 passed with stages
in 64 minutes and 14 seconds
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment