mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
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.
This commit is contained in:
parent
bac59c52f1
commit
51ed357597
2 changed files with 8 additions and 4 deletions
|
@ -1163,14 +1163,17 @@ 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_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;
|
||||
}
|
||||
gst_rtsp_range_free (range);
|
||||
}
|
||||
}
|
||||
|
||||
/* grab RTPInfo from the media now */
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue