sctp: fix build with GST_DISABLE_GST_DEBUG
authorSebastian Dröge <sebastian@centricular.com>
Fri, 7 Aug 2020 06:26:19 +0000 (09:26 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 14 Aug 2020 00:48:33 +0000 (01:48 +0100)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1465>

ext/sctp/sctpassociation.c

index ed1f92b..dd98eb1 100644 (file)
@@ -174,6 +174,7 @@ gst_sctp_association_class_init (GstSctpAssociationClass * klass)
   g_object_class_install_properties (gobject_class, NUM_PROPERTIES, properties);
 }
 
+#if defined(SCTP_DEBUG) && !defined(GST_DISABLE_GST_DEBUG)
 #define USRSCTP_GST_DEBUG_LEVEL GST_LEVEL_DEBUG
 static void
 gst_usrsctp_debug (const gchar * format, ...)
@@ -185,13 +186,18 @@ gst_usrsctp_debug (const gchar * format, ...)
       __FILE__, GST_FUNCTION, __LINE__, NULL, format, varargs);
   va_end (varargs);
 }
+#endif
 
 static void
 gst_sctp_association_init (GstSctpAssociation * self)
 {
   /* No need to lock mutex here as long as the function is only called from gst_sctp_association_get */
   if (number_of_associations == 0) {
+#if defined(SCTP_DEBUG) && !defined(GST_DISABLE_GST_DEBUG)
     usrsctp_init (0, sctp_packet_out, gst_usrsctp_debug);
+#else
+    usrsctp_init (0, sctp_packet_out, NULL);
+#endif
 
     /* Explicit Congestion Notification */
     usrsctp_sysctl_set_sctp_ecn_enable (0);