rtspsrc: Reset EOS flag also on FLUSH_STOP and not only on ssrc-active
authorSebastian Dröge <sebastian@centricular.com>
Mon, 14 Nov 2022 16:40:56 +0000 (18:40 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 16 Nov 2022 02:36:30 +0000 (02:36 +0000)
Also don't bother not sending EOS if EOS was sent already:
gst_pad_push_event() takes care of that for us already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>

subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c

index 8763f1b..65f767d 100644 (file)
@@ -3640,19 +3640,7 @@ gst_rtspsrc_do_stream_eos (GstRTSPSrc * src, GstRTSPStream * stream)
 {
   GST_DEBUG_OBJECT (src, "setting stream for session %u to EOS", stream->id);
 
-  if (stream->eos)
-    goto was_eos;
-
-  stream->eos = TRUE;
   gst_rtspsrc_stream_push_event (src, stream, gst_event_new_eos ());
-  return;
-
-  /* ERRORS */
-was_eos:
-  {
-    GST_DEBUG_OBJECT (src, "stream for session %u was already EOS", stream->id);
-    return;
-  }
 }
 
 static void
@@ -5155,6 +5143,17 @@ gst_rtspsrc_stream_push_event (GstRTSPSrc * src, GstRTSPStream * stream,
   if (!stream->setup)
     goto done;
 
+  switch (GST_EVENT_TYPE (event)) {
+    case GST_EVENT_EOS:
+      stream->eos = TRUE;
+      break;
+    case GST_EVENT_FLUSH_STOP:
+      stream->eos = FALSE;
+      break;
+    default:
+      break;
+  }
+
   if (stream->udpsrc[0]) {
     GstEvent *sent_event;