rtsp-media: If seeking fails, don't wait forever for the media to preroll again

Instead error out properly the same way as if the SEEKING query already
failed.
This commit is contained in:
Sebastian Dröge 2015-02-12 16:48:46 +02:00
parent dc43f427a9
commit 98b162f54b
2 changed files with 19 additions and 1 deletions

View file

@ -1165,7 +1165,10 @@ handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx)
if (gst_rtsp_range_parse (str, &range) == GST_RTSP_OK) {
/* we have a range, seek to the position */
unit = range->unit;
gst_rtsp_media_seek (media, range);
if (!gst_rtsp_media_seek (media, range)) {
gst_rtsp_range_free (range);
goto seek_failed;
}
gst_rtsp_range_free (range);
}
}
@ -1239,6 +1242,12 @@ unsuspend_failed:
send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx);
return FALSE;
}
seek_failed:
{
GST_ERROR ("client %p: seek failed", client);
send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx);
return FALSE;
}
unsupported_mode:
{
GST_ERROR ("client %p: media does not support PLAY", client);

View file

@ -1952,6 +1952,9 @@ gst_rtsp_media_seek (GstRTSPMedia * media, GstRTSPTimeRange * range)
/* and block for the seek to complete */
GST_INFO ("done seeking %d", res);
if (!res)
goto seek_failed;
g_rec_mutex_unlock (&priv->state_lock);
/* wait until pipeline is prerolled again, this will also collect stats */
@ -1987,6 +1990,12 @@ not_supported:
GST_WARNING ("conversion to npt not supported");
return FALSE;
}
seek_failed:
{
g_rec_mutex_unlock (&priv->state_lock);
GST_INFO ("seeking failed");
return FALSE;
}
preroll_failed:
{
GST_WARNING ("failed to preroll after seek");