From 5adc9b1d2f28c6ce298229c45347d4f2ea2d47fb Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 14 Nov 2017 23:07:26 +0900 Subject: xvimageallocator: Fix build warning error Fix unused variable build error if HAVE_XSHM is undefined https://bugzilla.gnome.org/show_bug.cgi?id=790329 --- sys/xvimage/xvimageallocator.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/xvimage/xvimageallocator.c b/sys/xvimage/xvimageallocator.c index 3a2728c23..a8c635884 100644 --- a/sys/xvimage/xvimageallocator.c +++ b/sys/xvimage/xvimageallocator.c @@ -350,7 +350,9 @@ gst_xvimage_allocator_alloc (GstXvImageAllocator * allocator, gint im_format, GstXvContext *context; gint align, offset; GstXvImageMemory *mem; +#ifdef HAVE_XSHM gint expected_size = 0; +#endif context = allocator->context; @@ -528,14 +530,6 @@ beach: return GST_MEMORY_CAST (mem); /* ERRORS */ -unexpected_size: - { - g_mutex_unlock (&context->lock); - g_set_error (error, GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_WRITE, - "unexpected XShm image size (got %d, expected %d)", - mem->xvimage->data_size, expected_size); - goto beach; - } create_failed: { g_mutex_unlock (&context->lock); @@ -549,6 +543,14 @@ create_failed: goto beach; } #ifdef HAVE_XSHM +unexpected_size: + { + g_mutex_unlock (&context->lock); + g_set_error (error, GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_WRITE, + "unexpected XShm image size (got %d, expected %d)", + mem->xvimage->data_size, expected_size); + goto beach; + } shmget_failed: { g_mutex_unlock (&context->lock); -- cgit v1.2.1