From 866c86dd377cd5d2ec08eddb9c457224ab7fe98e Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 18 Sep 2015 00:58:23 +1000 Subject: [PATCH] Fix some compiler warnings when building with G_DISABLE_ASSERT Touches rtpmanager and gdkpixbufsink --- ext/gdk_pixbuf/gstgdkpixbufsink.c | 13 +++++++++---- gst/rtpmanager/gstrtpbin.c | 1 + gst/rtpmanager/gstrtpsession.c | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ext/gdk_pixbuf/gstgdkpixbufsink.c b/ext/gdk_pixbuf/gstgdkpixbufsink.c index 5e7937855b..0151569e3e 100644 --- a/ext/gdk_pixbuf/gstgdkpixbufsink.c +++ b/ext/gdk_pixbuf/gstgdkpixbufsink.c @@ -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; diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index 0b81ba55d5..c7a0253269 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -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; } diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 844a75f5de..d3352fcb12 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -963,6 +963,7 @@ get_current_times (GstRtpSession * rtpsession, GstClockTime * running_time, ntpns = clock_time; break; default: + ntpns = -1; g_assert_not_reached (); break; }