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.
This commit is contained in:
Jan Schmidt 2015-09-18 00:20:13 +10:00
parent f82840ce88
commit 587e7c4a23
4 changed files with 35 additions and 6 deletions

View 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);

View 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++) {

View 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),

View 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
}