summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-07-05 21:11:35 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-07-25 13:16:53 +0300
commitc70ac7f1e6651745b052534b7af672bf2e57048f (patch)
tree0d7da2889a3963bd72377ffcf5ecd146e13f879a
parent210db14f661c26a0547a5f403ac39d96563b5782 (diff)
downloadgstreamer-plugins-good-c70ac7f1e6651745b052534b7af672bf2e57048f.tar.gz
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.
-rw-r--r--gst/rtsp/gstrtspsrc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index c8ac54127..0135c1066 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -2170,15 +2170,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 */
@@ -2207,6 +2198,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;