xvimageallocator: Fix build warning error

Fix unused variable build error if HAVE_XSHM is undefined

https://bugzilla.gnome.org/show_bug.cgi?id=790329
This commit is contained in:
Seungha Yang 2017-11-14 23:07:26 +09:00 committed by Nicolas Dufresne
parent 427df2d5d9
commit e1e46b674f

View file

@ -351,7 +351,9 @@ gst_xvimage_allocator_alloc (GstXvImageAllocator * allocator, gint im_format,
GstXvContext *context; GstXvContext *context;
gint align, offset; gint align, offset;
GstXvImageMemory *mem; GstXvImageMemory *mem;
#ifdef HAVE_XSHM
gint expected_size = 0; gint expected_size = 0;
#endif
context = allocator->context; context = allocator->context;
@ -529,14 +531,6 @@ beach:
return GST_MEMORY_CAST (mem); return GST_MEMORY_CAST (mem);
/* ERRORS */ /* 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: create_failed:
{ {
g_mutex_unlock (&context->lock); g_mutex_unlock (&context->lock);
@ -550,6 +544,14 @@ create_failed:
goto beach; goto beach;
} }
#ifdef HAVE_XSHM #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: shmget_failed:
{ {
g_mutex_unlock (&context->lock); g_mutex_unlock (&context->lock);