client: suspend after SDP and unsuspend before PLAYING

Based on patches by Ognyan Tonchev <ognyan@axis.com>

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711257
This commit is contained in:
Wim Taymans 2013-11-28 14:14:35 +01:00
parent 2f17369e9d
commit b1e8172ef3

View file

@ -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,