From 4e1d65983a94a85e6ba4e1248b321aaaf053391e Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 29 Sep 2013 13:42:22 +0200 Subject: [PATCH] vaapi: fix inverted condition How embarrassing. This could make --hwdec=vaapi-copy as well as screenshots with vo_vaapi randomly fail. Regression since commit b8382aa. --- video/vaapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/vaapi.c b/video/vaapi.c index 2f31edee66..9a8ab1ac29 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -341,7 +341,7 @@ static VAImage *va_surface_image_alloc(struct va_surface *surface, va_surface_image_destroy(surface); VAStatus status = vaDeriveImage(p->display, surface->id, &p->image); - if (status != VA_STATUS_SUCCESS) { + if (status == VA_STATUS_SUCCESS) { /* vaDeriveImage() is supported, check format */ if (p->image.format.fourcc == format->fourcc && p->image.width == surface->w && p->image.height == surface->h) { @@ -349,11 +349,11 @@ static VAImage *va_surface_image_alloc(struct va_surface *surface, VA_VERBOSE("Using vaDeriveImage()\n"); } else { vaDestroyImage(p->display, p->image.image_id); - p->image.image_id = VA_INVALID_ID; status = VA_STATUS_ERROR_OPERATION_FAILED; } } if (status != VA_STATUS_SUCCESS) { + p->image.image_id = VA_INVALID_ID; status = vaCreateImage(p->display, format, surface->w, surface->h, &p->image); if (!check_va_status(status, "vaCreateImage()")) {