Fix some compiler warnings when building with G_DISABLE_ASSERT

Touches rtpmanager and gdkpixbufsink
This commit is contained in:
Jan Schmidt 2015-09-18 00:58:23 +10:00 committed by Jan Schmidt
parent 563ffc0d8f
commit 866c86dd37
3 changed files with 11 additions and 4 deletions

View file

@ -229,7 +229,7 @@ gst_gdk_pixbuf_sink_set_caps (GstBaseSink * basesink, GstCaps * caps)
GstGdkPixbufSink *sink = GST_GDK_PIXBUF_SINK (basesink);
GstVideoInfo info;
GstVideoFormat fmt;
gint w, h, s, par_n, par_d;
gint w, h, par_n, par_d;
GST_LOG_OBJECT (sink, "caps: %" GST_PTR_FORMAT, caps);
@ -241,12 +241,17 @@ gst_gdk_pixbuf_sink_set_caps (GstBaseSink * basesink, GstCaps * caps)
fmt = GST_VIDEO_INFO_FORMAT (&info);
w = GST_VIDEO_INFO_WIDTH (&info);
h = GST_VIDEO_INFO_HEIGHT (&info);
s = GST_VIDEO_INFO_COMP_PSTRIDE (&info, 0);
par_n = GST_VIDEO_INFO_PAR_N (&info);
par_d = GST_VIDEO_INFO_PAR_N (&info);
g_assert ((fmt == GST_VIDEO_FORMAT_RGB && s == 3) ||
(fmt == GST_VIDEO_FORMAT_RGBA && s == 4));
#ifndef G_DISABLE_ASSERT
{
gint s;
s = GST_VIDEO_INFO_COMP_PSTRIDE (&info, 0);
g_assert ((fmt == GST_VIDEO_FORMAT_RGB && s == 3) ||
(fmt == GST_VIDEO_FORMAT_RGBA && s == 4));
}
#endif
GST_VIDEO_SINK_WIDTH (sink) = w;
GST_VIDEO_SINK_HEIGHT (sink) = h;

View file

@ -1046,6 +1046,7 @@ get_current_times (GstRtpBin * bin, GstClockTime * running_time,
ntpns = clock_time;
break;
default:
ntpns = -1; /* Fix uninited compiler warning */
g_assert_not_reached ();
break;
}

View file

@ -963,6 +963,7 @@ get_current_times (GstRtpSession * rtpsession, GstClockTime * running_time,
ntpns = clock_time;
break;
default:
ntpns = -1;
g_assert_not_reached ();
break;
}