From 671b1ea305843eb747b0edcb62e0fca0e1471019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 18 Feb 2015 11:46:11 +0200 Subject: [PATCH] Fix compiler warnings This patch fixes some warnings that gcc 4.9 reports. https://bugzilla.gnome.org/show_bug.cgi?id=744411 --- gst-libs/gst/vaapi/Makefile.am | 2 +- gst-libs/gst/vaapi/gstvaapibufferproxy.c | 2 +- gst-libs/gst/vaapi/gstvaapidecoder.c | 3 ++- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 3 +-- gst-libs/gst/vaapi/gstvaapidisplay.c | 2 +- gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c | 22 ---------------------- gst/vaapi/gstvaapivideomemory.c | 2 +- 7 files changed, 7 insertions(+), 29 deletions(-) diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am index 8332af4de3..57b831350e 100644 --- a/gst-libs/gst/vaapi/Makefile.am +++ b/gst-libs/gst/vaapi/Makefile.am @@ -454,7 +454,6 @@ libgstvaapi_wayland_@GST_API_VERSION@_la_CFLAGS = \ $(GST_VIDEO_CFLAGS) \ $(WAYLAND_CFLAGS) \ $(LIBVA_WAYLAND_CFLAGS) \ - $(top_builddir)/gst-libs/gst/video/libgstvaapi-videoutils.la \ $(NULL) libgstvaapi_wayland_@GST_API_VERSION@_la_LIBADD = \ @@ -464,6 +463,7 @@ libgstvaapi_wayland_@GST_API_VERSION@_la_LIBADD = \ $(WAYLAND_LIBS) \ $(LIBVA_WAYLAND_LIBS) \ libgstvaapi-$(GST_API_VERSION).la \ + $(top_builddir)/gst-libs/gst/video/libgstvaapi-videoutils.la \ $(NULL) libgstvaapi_wayland_@GST_API_VERSION@_la_LDFLAGS = \ diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy.c b/gst-libs/gst/vaapi/gstvaapibufferproxy.c index 22e17f2a96..c8904a720c 100644 --- a/gst-libs/gst/vaapi/gstvaapibufferproxy.c +++ b/gst-libs/gst/vaapi/gstvaapibufferproxy.c @@ -286,7 +286,7 @@ gst_vaapi_buffer_proxy_get_type (GstVaapiBufferProxy * proxy) guintptr gst_vaapi_buffer_proxy_get_handle (GstVaapiBufferProxy * proxy) { - g_return_val_if_fail (proxy != NULL, NULL); + g_return_val_if_fail (proxy != NULL, 0); return GST_VAAPI_BUFFER_PROXY_HANDLE (proxy); } diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c index fde845086b..3ef4cbab8b 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder.c @@ -908,8 +908,9 @@ gst_interlace_mode_to_string (GstVideoInterlaceMode mode) return "interleaved"; case GST_VIDEO_INTERLACE_MODE_MIXED: return "mixed"; + default: + return ""; } - return ""; } void diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index 9730e124ab..ffc06d5723 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -2561,7 +2561,7 @@ exec_picture_refs_modification_1( GstH264RefPicListModification *ref_pic_list_modification; guint num_ref_pic_list_modifications; GstVaapiPictureH264 **ref_list; - guint *ref_list_count_ptr, ref_list_count, ref_list_idx = 0; + guint *ref_list_count_ptr, ref_list_idx = 0; const guint16 *view_ids = NULL; guint i, j, n, num_refs, num_view_ids = 0; gint found_ref_idx; @@ -2611,7 +2611,6 @@ exec_picture_refs_modification_1( } } } - ref_list_count = *ref_list_count_ptr; if (!GST_VAAPI_PICTURE_IS_FRAME(picture)) { MaxPicNum = 1 << (sps->log2_max_frame_num_minus4 + 5); // 2 * MaxFrameNum diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 0115c74648..fc37102998 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -2134,7 +2134,7 @@ gst_vaapi_display_has_opengl (GstVaapiDisplay * display) { GstVaapiDisplayClass *klass; - g_return_val_if_fail (display != NULL, NULL); + g_return_val_if_fail (display != NULL, FALSE); klass = GST_VAAPI_DISPLAY_GET_CLASS (display); return (klass->display_type == GST_VAAPI_DISPLAY_TYPE_GLX); diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c b/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c index 785b3bb45f..f959b268c4 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c @@ -134,8 +134,6 @@ generate_sampling_factors (GstVaapiEncoderJpeg * encoder) static GstVaapiEncoderStatus ensure_profile (GstVaapiEncoderJpeg * encoder) { - GstVaapiProfile profile; - /* Always start from "simple" profile for maximum compatibility */ encoder->profile = GST_VAAPI_PROFILE_JPEG_BASELINE; @@ -210,9 +208,7 @@ fill_picture (GstVaapiEncoderJpeg * encoder, GstVaapiEncPicture * picture, GstVaapiCodedBuffer * codedbuf, GstVaapiSurfaceProxy * surface) { - GstVaapiEncoder *const base_encoder = GST_VAAPI_ENCODER_CAST (encoder); VAEncPictureParameterBufferJPEG *const pic_param = picture->param; - GstVideoInfo *vinfo = GST_VAAPI_ENCODER_VIDEO_INFO (encoder); memset (pic_param, 0, sizeof (VAEncPictureParameterBufferJPEG)); @@ -572,13 +568,6 @@ bs_write_jpeg_header (GstBitWriter * bs, GstVaapiEncoderJpeg * encoder, gst_bit_writer_put_bits_uint8 (bs, 0, 4); //0 for Baseline return TRUE; - - /* ERRORS */ -bs_error: - { - GST_WARNING ("failed to write Jpeg raw data header"); - return FALSE; - } } static gboolean @@ -611,14 +600,6 @@ add_packed_header (GstVaapiEncoderJpeg * encoder, GstVaapiEncPicture * picture) gst_bit_writer_clear (&bs, TRUE); return TRUE; - - /* ERRORS */ -bs_error: - { - GST_WARNING ("failed to write Packed Raw Data header"); - gst_bit_writer_clear (&bs, TRUE); - return FALSE; - } } static gboolean @@ -722,9 +703,6 @@ gst_vaapi_encoder_jpeg_reconfigure (GstVaapiEncoder * base_encoder) generate_sampling_factors (encoder); return set_context_info (base_encoder); - -error: - return GST_VAAPI_ENCODER_STATUS_ERROR_OPERATION_FAILED; } static gboolean diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 04b49f247e..96a4b1e04c 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -370,7 +370,7 @@ gst_vaapi_video_memory_reset_surface (GstVaapiVideoMemory * mem) gboolean gst_vaapi_video_memory_sync (GstVaapiVideoMemory * mem) { - g_return_val_if_fail (mem, NULL); + g_return_val_if_fail (mem, FALSE); return ensure_surface_is_current (mem); }