Don't throw compiler warnings with G_DISABLE_ASSERT
authorJan Schmidt <jan@centricular.com>
Thu, 17 Sep 2015 14:20:13 +0000 (00:20 +1000)
committerJan Schmidt <jan@centricular.com>
Thu, 17 Sep 2015 14:29:51 +0000 (00:29 +1000)
Disable code that warns about unused variables when G_DISABLE_ASSERT
is defined, as it is in tarballs and pre-releases.

ext/dtls/gstdtlsconnection.c
ext/dts/gstdtsdec.c
ext/gl/gstglstereomix.c
gst/audiomixer/gstaudioaggregator.c

index 3369a1462ef21b667825950627eae699ffed529a..36f6d635f10baf7a0b51bb8e97a5d1e24863c88d 100644 (file)
@@ -355,12 +355,18 @@ gst_dtls_connection_check_timeout_locked (GstDtlsConnection * self)
     GST_DEBUG_OBJECT (self, "waiting for %" G_GINT64_FORMAT " usec", wait_time);
     if (wait_time) {
       GstClockID clock_id;
+#ifndef G_DISABLE_ASSERT
       GstClockReturn clock_return;
+#endif
 
       end_time = gst_clock_get_time (system_clock) + wait_time * GST_USECOND;
 
       clock_id = gst_clock_new_single_shot_id (system_clock, end_time);
+#ifndef G_DISABLE_ASSERT
       clock_return =
+#else
+      (void)
+#endif
           gst_clock_id_wait_async (clock_id, schedule_timeout_handling,
           g_object_ref (self), (GDestroyNotify) g_object_unref);
       g_assert (clock_return == GST_CLOCK_OK);
index 75199ccd5e028ee63d7b3247123d5925c208b8ee..c1f12c50b3380f987494887b3bb4044f142ca309 100644 (file)
@@ -458,10 +458,13 @@ gst_dtsdec_handle_frame (GstAudioDecoder * bdec, GstBuffer * buffer)
   gint channels, i, num_blocks;
   gboolean need_renegotiation = FALSE;
   guint8 *data;
-  gsize size;
   GstMapInfo map;
   gint chans;
-  gint length, flags, sample_rate, bit_rate, frame_length;
+#ifndef G_DISABLE_ASSERT
+  gsize size;
+  gint length;
+#endif
+  gint flags, sample_rate, bit_rate, frame_length;
   GstFlowReturn result = GST_FLOW_OK;
   GstBuffer *outbuf;
 
@@ -474,15 +477,24 @@ gst_dtsdec_handle_frame (GstAudioDecoder * bdec, GstBuffer * buffer)
   /* parsed stuff already, so this should work out fine */
   gst_buffer_map (buffer, &map, GST_MAP_READ);
   data = map.data;
+
+#ifndef G_DISABLE_ASSERT
   size = map.size;
   g_assert (size >= 7);
+#endif
 
   bit_rate = dts->bit_rate;
   sample_rate = dts->sample_rate;
   flags = 0;
+
+#ifndef G_DISABLE_ASSERT
   length = dca_syncinfo (dts->state, data, &flags, &sample_rate, &bit_rate,
       &frame_length);
   g_assert (length == size);
+#else
+  (void) dca_syncinfo (dts->state, data, &flags, &sample_rate, &bit_rate,
+      &frame_length);
+#endif
 
   if (flags != dts->prev_flags) {
     dts->prev_flags = flags;
@@ -597,7 +609,6 @@ gst_dtsdec_handle_frame (GstAudioDecoder * bdec, GstBuffer * buffer)
 
   gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
   data = map.data;
-  size = map.size;
   {
     guint8 *ptr = data;
     for (i = 0; i < num_blocks; i++) {
index 731569a67b311816b5fa03fc18941bdf803dd42c..b880d06357ca467efd9d224a7705a70e527a289c 100644 (file)
@@ -503,7 +503,10 @@ gst_gl_stereo_mix_process_frames (GstGLStereoMix * mixer, GPtrArray * frames)
   GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (mixer);
   GstBuffer *converted_buffer, *inbuf;
   GstVideoInfo *out_info = &vagg->info;
-  gint count = 0, n;
+  gint count = 0;
+#ifndef G_DISABLE_ASSERT
+  gint n;
+#endif
   gint v, views;
   gint valid_views = 0;
 
@@ -574,8 +577,12 @@ gst_gl_stereo_mix_process_frames (GstGLStereoMix * mixer, GPtrArray * frames)
     return FALSE;
 
   converted_buffer = mixer->primary_out;
+
+#ifndef G_DISABLE_ASSERT
   n = gst_buffer_n_memory (converted_buffer);
   g_assert (n == GST_VIDEO_INFO_N_PLANES (out_info) * views);
+#endif
+
   for (v = 0; v < views; v++) {
     gst_buffer_add_video_meta_full (converted_buffer, v,
         GST_VIDEO_INFO_FORMAT (out_info),
index c30bc64867e2f80707cd6081ed1fcd82279310e2..1d3dcb56b4f2f144c7e65ca6972e843e8d60b3ac 100644 (file)
@@ -625,13 +625,18 @@ void
 gst_audio_aggregator_set_sink_caps (GstAudioAggregator * aagg,
     GstAudioAggregatorPad * pad, GstCaps * caps)
 {
+#ifndef G_DISABLE_ASSERT
   gboolean valid;
 
   GST_OBJECT_LOCK (pad);
   valid = gst_audio_info_from_caps (&pad->info, caps);
-  GST_OBJECT_UNLOCK (pad);
-
   g_assert (valid);
+
+#else
+  GST_OBJECT_LOCK (pad);
+  (void) gst_audio_info_from_caps (&pad->info, caps);
+  GST_OBJECT_UNLOCK (pad);
+#endif
 }