xvimageallocator: Fix build warning error
authorSeungha Yang <pudding8757@gmail.com>
Tue, 14 Nov 2017 14:07:26 +0000 (23:07 +0900)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 6 Dec 2017 20:28:54 +0000 (15:28 -0500)
Fix unused variable build error if HAVE_XSHM is undefined

https://bugzilla.gnome.org/show_bug.cgi?id=790329

sys/xvimage/xvimageallocator.c

index 429c5aa..bf1f2bd 100644 (file)
@@ -351,7 +351,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;
 
@@ -529,14 +531,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);
@@ -550,6 +544,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);