summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-02-13 12:21:16 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-02-13 12:21:16 +0200
commit51ed357597eec8d3ca51427f4788afada3154c45 (patch)
treeb2c3f99b19ef414ecb65116d862db88b1fdacc8c /gst
parentbac59c52f18310893d906c7076bdd07a85fa9744 (diff)
rtsp-client: Only error out in PLAY if seeking actually failed
If the media was just not seekable, we continue from whatever position we are and let the client decide if that is what is wanted or not. Only if the actual seek failed, we can't really recover and should error out.
Diffstat (limited to 'gst')
-rw-r--r--gst/rtsp-server/rtsp-client.c11
-rw-r--r--gst/rtsp-server/rtsp-media.c1
2 files changed, 8 insertions, 4 deletions
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c
index 8e8f73a..bedc464 100644
--- a/gst/rtsp-server/rtsp-client.c
+++ b/gst/rtsp-server/rtsp-client.c
@@ -1163,13 +1163,16 @@ handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx)
res = gst_rtsp_message_get_header (ctx->request, GST_RTSP_HDR_RANGE, &str, 0);
if (res == GST_RTSP_OK) {
if (gst_rtsp_range_parse (str, &range) == GST_RTSP_OK) {
+ GstRTSPMediaStatus media_status;
+
/* we have a range, seek to the position */
unit = range->unit;
- if (!gst_rtsp_media_seek (media, range)) {
- gst_rtsp_range_free (range);
- goto seek_failed;
- }
+ gst_rtsp_media_seek (media, range);
gst_rtsp_range_free (range);
+
+ media_status = gst_rtsp_media_get_status (media);
+ if (media_status == GST_RTSP_MEDIA_STATUS_ERROR)
+ goto seek_failed;
}
}
diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c
index f97490b..65ad9ff 100644
--- a/gst/rtsp-server/rtsp-media.c
+++ b/gst/rtsp-server/rtsp-media.c
@@ -1994,6 +1994,7 @@ seek_failed:
{
g_rec_mutex_unlock (&priv->state_lock);
GST_INFO ("seeking failed");
+ gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_ERROR);
return FALSE;
}
preroll_failed: