mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rtspsrc: When seeking, consider the current element state or pending state instead of the RTSP state
If we consider the RTSP state, what can happen is that it is PLAYING but the element already asynchronously tried to PAUSE and it just did not happen yet. We would then override this setting to PAUSED (while the element actually is in PAUSED) and set the RTSP state to PLAYING again. This would then cause us to produce packets while the sinks are all PAUSED, piling up thousands of packets in the rtpjitterbuffer and other elements and finally failing.
This commit is contained in:
parent
d6f597db20
commit
c18b609c06
1 changed files with 7 additions and 3 deletions
|
@ -2170,9 +2170,8 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
|
||||||
if ((stop = seeksegment.stop) == -1)
|
if ((stop = seeksegment.stop) == -1)
|
||||||
stop = seeksegment.duration;
|
stop = seeksegment.duration;
|
||||||
|
|
||||||
playing = (src->state == GST_RTSP_STATE_PLAYING);
|
|
||||||
|
|
||||||
/* if we were playing, pause first */
|
/* if we were playing, pause first */
|
||||||
|
playing = (src->state == GST_RTSP_STATE_PLAYING);
|
||||||
if (playing) {
|
if (playing) {
|
||||||
/* obtain current position in case seek fails */
|
/* obtain current position in case seek fails */
|
||||||
gst_rtspsrc_get_position (src);
|
gst_rtspsrc_get_position (src);
|
||||||
|
@ -2185,7 +2184,12 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
|
||||||
/* PLAY will add the range header now. */
|
/* PLAY will add the range header now. */
|
||||||
src->need_range = TRUE;
|
src->need_range = TRUE;
|
||||||
|
|
||||||
/* and continue playing */
|
/* and continue playing if needed */
|
||||||
|
GST_OBJECT_LOCK (src);
|
||||||
|
playing = (GST_STATE_PENDING (src) == GST_STATE_VOID_PENDING
|
||||||
|
&& GST_STATE (src) == GST_STATE_PLAYING)
|
||||||
|
|| (GST_STATE_PENDING (src) == GST_STATE_PLAYING);
|
||||||
|
GST_OBJECT_UNLOCK (src);
|
||||||
if (playing)
|
if (playing)
|
||||||
gst_rtspsrc_play (src, &seeksegment, FALSE);
|
gst_rtspsrc_play (src, &seeksegment, FALSE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue