summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-29 13:42:22 +0200
committerwm4 <wm4@nowhere>2013-09-29 13:45:15 +0200
commit4e1d65983a94a85e6ba4e1248b321aaaf053391e (patch)
tree22252918da667df867c9a40ad75f07b35138088a /video
parent9d3943840cb472e7921a933a06477f53eca4a17e (diff)
downloadmpv-4e1d65983a94a85e6ba4e1248b321aaaf053391e.tar.bz2
mpv-4e1d65983a94a85e6ba4e1248b321aaaf053391e.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/vaapi.c4
1 files 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()")) {