From b9532527ece3241741b666a68c9c91a878a9fca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 5 Jul 2016 21:11:35 +0300 Subject: [PATCH] rtspsrc: Set to PLAYING after a seek again after setting up the segment and everything else There's a small window for a race condition otherwise. --- gst/rtsp/gstrtspsrc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index f63ba9de06..4c6a47edbc 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -2184,15 +2184,6 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event) /* PLAY will add the range header now. */ src->need_range = TRUE; - /* 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) - gst_rtspsrc_play (src, &seeksegment, FALSE); - /* prepare for streaming again */ if (flush) { /* if we started flush, we stop now */ @@ -2221,6 +2212,15 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event) stream->discont = TRUE; } + /* 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) + gst_rtspsrc_play (src, &seeksegment, FALSE); + GST_RTSP_STREAM_UNLOCK (src); return TRUE;