From b1e8172ef366458eecccd5f0d3b77d87fbb30d4a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 28 Nov 2013 14:14:35 +0100 Subject: [PATCH] client: suspend after SDP and unsuspend before PLAYING Based on patches by Ognyan Tonchev Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711257 --- gst/rtsp-server/rtsp-client.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 76f8c8c476..162f52ce6e 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -1074,6 +1074,10 @@ handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx) if (rtspstate != GST_RTSP_STATE_PLAYING && rtspstate != GST_RTSP_STATE_READY) goto invalid_state; + /* in play we first unsuspend, media could be suspended from SDP or PAUSED */ + if (!gst_rtsp_media_unsuspend (media)) + goto unsuspend_failed; + /* parse the range header if we have one */ res = gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_RANGE, &str, 0); if (res == GST_RTSP_OK) { @@ -1194,6 +1198,13 @@ invalid_state: g_free (path); return FALSE; } +unsuspend_failed: + { + GST_ERROR ("client %p: unsuspend failed", client); + send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx); + g_free (path); + return FALSE; + } } static void @@ -1755,6 +1766,8 @@ handle_describe_request (GstRTSPClient * client, GstRTSPContext * ctx) if (!(sdp = klass->create_sdp (client, media))) goto no_sdp; + /* we suspend after the describe */ + gst_rtsp_media_suspend (media); g_object_unref (media); gst_rtsp_message_init_response (ctx->response, GST_RTSP_STS_OK,