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 e678192b5a..ef8865e06b 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c @@ -1169,7 +1169,6 @@ struct _GstVaAllocator guint32 fourcc; guint32 rt_format; - GstVideoInfo derived_info; GstVideoInfo info; guint usage_hint; @@ -1329,9 +1328,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 */ } @@ -1350,6 +1347,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); @@ -1412,24 +1410,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; } -#endif } - if (use_derived) - info = &va_allocator->derived_info; - else - info = &va_allocator->info; +#endif + info = &va_allocator->info; if (!va_ensure_image (display, mem->surface, info, &mem->image, use_derived)) return NULL;