rtpsrc: drop stream-start & eos messages posted from the internal udp sink(s)
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 28 Jul 2020 09:16:10 +0000 (12:16 +0300)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 29 Jul 2020 13:20:28 +0000 (13:20 +0000)
See #1368

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1472>

gst/rtp/gstrtpsrc.c

index 4da0901..f8c29a7 100644 (file)
@@ -293,15 +293,33 @@ gst_rtp_src_finalize (GObject * gobject)
 }
 
 static void
+gst_rtp_src_handle_message (GstBin * bin, GstMessage * message)
+{
+  switch (GST_MESSAGE_TYPE (message)) {
+    case GST_MESSAGE_STREAM_START:
+    case GST_MESSAGE_EOS:
+      /* drop stream-start & eos from our internal udp sink(s);
+         https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1368 */
+      gst_message_unref (message);
+      break;
+    default:
+      GST_BIN_CLASS (parent_class)->handle_message (bin, message);
+      break;
+  }
+}
+
+static void
 gst_rtp_src_class_init (GstRtpSrcClass * klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
+  GstBinClass *gstbin_class = GST_BIN_CLASS (klass);
 
   gobject_class->set_property = gst_rtp_src_set_property;
   gobject_class->get_property = gst_rtp_src_get_property;
   gobject_class->finalize = gst_rtp_src_finalize;
   gstelement_class->change_state = gst_rtp_src_change_state;
+  gstbin_class->handle_message = gst_rtp_src_handle_message;
 
   /**
    * GstRtpSrc:uri: