diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c index faf8c63a6f..e418e6be07 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c @@ -1091,7 +1091,6 @@ struct _GstVaAllocator guint32 fourcc; guint32 rt_format; - GstVideoInfo derived_info; GstVideoInfo info; guint usage_hint; @@ -1307,9 +1306,7 @@ _update_image_info (GstVaAllocator * va_allocator) && va_allocator->surface_format == va_allocator->img_format) { if (va_get_derive_image (va_allocator->display, surface, &image)) { va_allocator->use_derived = TRUE; - va_allocator->derived_info = va_allocator->info; - _update_info (&va_allocator->derived_info, &image); - va_destroy_image (va_allocator->display, image.image_id); + goto done; } image.image_id = VA_INVALID_ID; /* reset it */ } @@ -1328,6 +1325,7 @@ _update_image_info (GstVaAllocator * va_allocator) return FALSE; } +done: _update_info (&va_allocator->info, &image); va_destroy_image (va_allocator->display, image.image_id); va_destroy_surfaces (va_allocator->display, &surface, 1); @@ -1386,23 +1384,21 @@ _va_map_unlocked (GstVaMemory * mem, GstMapFlags flags) * problematic */ use_derived = va_allocator->use_derived && !((flags & GST_MAP_READ) || ((flags & GST_MAP_WRITE) - && GST_VIDEO_INFO_IS_YUV (&va_allocator->derived_info))); + && GST_VIDEO_INFO_IS_YUV (&va_allocator->info))); break; case GST_VA_IMPLEMENTATION_MESA_GALLIUM: /* Reading RGB derived images, with non-standard resolutions, * looks like tiled too. TODO(victor): fill a bug in Mesa. */ use_derived = va_allocator->use_derived && !((flags & GST_MAP_READ) - && GST_VIDEO_INFO_IS_RGB (&va_allocator->derived_info)); + && GST_VIDEO_INFO_IS_RGB (&va_allocator->info)); break; default: use_derived = va_allocator->use_derived; break; } } - if (use_derived) - info = &va_allocator->derived_info; - else - info = &va_allocator->info; + + info = &va_allocator->info; if (!va_ensure_image (display, mem->surface, info, &mem->image, use_derived)) return NULL;