From 587e7c4a23d8364f13e3710cea75d4a72b2b301f Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 18 Sep 2015 00:20:13 +1000 Subject: Don't throw compiler warnings with G_DISABLE_ASSERT 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 | 6 ++++++ ext/dts/gstdtsdec.c | 17 ++++++++++++++--- ext/gl/gstglstereomix.c | 9 ++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) (limited to 'ext') diff --git a/ext/dtls/gstdtlsconnection.c b/ext/dtls/gstdtlsconnection.c index 3369a1462..36f6d635f 100644 --- a/ext/dtls/gstdtlsconnection.c +++ b/ext/dtls/gstdtlsconnection.c @@ -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); diff --git a/ext/dts/gstdtsdec.c b/ext/dts/gstdtsdec.c index 75199ccd5..c1f12c50b 100644 --- a/ext/dts/gstdtsdec.c +++ b/ext/dts/gstdtsdec.c @@ -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++) { diff --git a/ext/gl/gstglstereomix.c b/ext/gl/gstglstereomix.c index 731569a67..b880d0635 100644 --- a/ext/gl/gstglstereomix.c +++ b/ext/gl/gstglstereomix.c @@ -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), -- cgit v1.2.1