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.
This commit is contained in:
Sebastian Dröge 2016-07-05 21:11:35 +03:00
parent 6289280535
commit b9532527ec

View file

@ -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;