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.
This commit is contained in:
wm4 2013-09-29 13:42:22 +02:00
parent 9d3943840c
commit 4e1d65983a
1 changed files with 2 additions and 2 deletions

View File

@ -341,7 +341,7 @@ static VAImage *va_surface_image_alloc(struct va_surface *surface,
va_surface_image_destroy(surface); va_surface_image_destroy(surface);
VAStatus status = vaDeriveImage(p->display, surface->id, &p->image); VAStatus status = vaDeriveImage(p->display, surface->id, &p->image);
if (status != VA_STATUS_SUCCESS) { if (status == VA_STATUS_SUCCESS) {
/* vaDeriveImage() is supported, check format */ /* vaDeriveImage() is supported, check format */
if (p->image.format.fourcc == format->fourcc && if (p->image.format.fourcc == format->fourcc &&
p->image.width == surface->w && p->image.height == surface->h) { 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"); VA_VERBOSE("Using vaDeriveImage()\n");
} else { } else {
vaDestroyImage(p->display, p->image.image_id); vaDestroyImage(p->display, p->image.image_id);
p->image.image_id = VA_INVALID_ID;
status = VA_STATUS_ERROR_OPERATION_FAILED; status = VA_STATUS_ERROR_OPERATION_FAILED;
} }
} }
if (status != VA_STATUS_SUCCESS) { if (status != VA_STATUS_SUCCESS) {
p->image.image_id = VA_INVALID_ID;
status = vaCreateImage(p->display, format, surface->w, surface->h, status = vaCreateImage(p->display, format, surface->w, surface->h,
&p->image); &p->image);
if (!check_va_status(status, "vaCreateImage()")) { if (!check_va_status(status, "vaCreateImage()")) {