mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
rtspsrc: Properly set segments seqnums after seeks
This commit is contained in:
parent
9189cdcb1d
commit
fd7ecac793
2 changed files with 9 additions and 0 deletions
|
@ -1394,6 +1394,7 @@ gst_rtspsrc_init (GstRTSPSrc * src)
|
||||||
src->onvif_mode = DEFAULT_ONVIF_MODE;
|
src->onvif_mode = DEFAULT_ONVIF_MODE;
|
||||||
src->onvif_rate_control = DEFAULT_ONVIF_RATE_CONTROL;
|
src->onvif_rate_control = DEFAULT_ONVIF_RATE_CONTROL;
|
||||||
src->is_live = DEFAULT_IS_LIVE;
|
src->is_live = DEFAULT_IS_LIVE;
|
||||||
|
src->seek_seqnum = GST_SEQNUM_INVALID;
|
||||||
|
|
||||||
/* get a list of all extensions */
|
/* get a list of all extensions */
|
||||||
src->extensions = gst_rtsp_ext_list_get ();
|
src->extensions = gst_rtsp_ext_list_get ();
|
||||||
|
@ -2920,6 +2921,7 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
|
||||||
/* If an accurate seek was requested, we want to clip the segment we
|
/* If an accurate seek was requested, we want to clip the segment we
|
||||||
* output in ONVIF mode to the requested bounds */
|
* output in ONVIF mode to the requested bounds */
|
||||||
src->clip_out_segment = ! !(flags & GST_SEEK_FLAG_ACCURATE);
|
src->clip_out_segment = ! !(flags & GST_SEEK_FLAG_ACCURATE);
|
||||||
|
src->seek_seqnum = gst_event_get_seqnum (event);
|
||||||
|
|
||||||
if (playing)
|
if (playing)
|
||||||
gst_rtspsrc_play (src, &seeksegment, FALSE, seek_style);
|
gst_rtspsrc_play (src, &seeksegment, FALSE, seek_style);
|
||||||
|
@ -2992,6 +2994,7 @@ gst_rtspsrc_handle_src_sink_event (GstPad * pad, GstObject * parent,
|
||||||
GstEvent * event)
|
GstEvent * event)
|
||||||
{
|
{
|
||||||
GstRTSPStream *stream;
|
GstRTSPStream *stream;
|
||||||
|
GstRTSPSrc *self = GST_RTSPSRC (GST_OBJECT_PARENT (parent));
|
||||||
|
|
||||||
stream = gst_pad_get_element_private (pad);
|
stream = gst_pad_get_element_private (pad);
|
||||||
|
|
||||||
|
@ -3008,6 +3011,10 @@ gst_rtspsrc_handle_src_sink_event (GstPad * pad, GstObject * parent,
|
||||||
g_free (stream_id);
|
g_free (stream_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GST_EVENT_SEGMENT:
|
||||||
|
if (self->seek_seqnum != GST_SEQNUM_INVALID)
|
||||||
|
GST_EVENT_SEQNUM (event) = self->seek_seqnum;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -9175,6 +9182,7 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
|
||||||
ret = GST_STATE_CHANGE_SUCCESS;
|
ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
|
rtspsrc->seek_seqnum = GST_SEQNUM_INVALID;
|
||||||
gst_rtspsrc_loop_send_cmd_and_wait (rtspsrc, CMD_CLOSE, CMD_ALL,
|
gst_rtspsrc_loop_send_cmd_and_wait (rtspsrc, CMD_CLOSE, CMD_ALL,
|
||||||
rtspsrc->teardown_timeout);
|
rtspsrc->teardown_timeout);
|
||||||
ret = GST_STATE_CHANGE_SUCCESS;
|
ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
|
|
|
@ -303,6 +303,7 @@ struct _GstRTSPSrc {
|
||||||
* between any two random access points
|
* between any two random access points
|
||||||
* */
|
* */
|
||||||
gfloat seekable;
|
gfloat seekable;
|
||||||
|
guint32 seek_seqnum;
|
||||||
GstClockTime last_pos;
|
GstClockTime last_pos;
|
||||||
|
|
||||||
/* session management */
|
/* session management */
|
||||||
|
|
Loading…
Reference in a new issue