summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gbeauchesne@splitted-desktop.com>2009-11-18 10:05:31 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2009-11-18 11:51:11 +0800
commit88df301b97c64bd487787e0f15df6e4e91b33376 (patch)
tree48ce94bdaac50b81de11c158b6423d99601a38dd
parent79c81df3bff6cf5e58ceebe3e4b97d67a73043c4 (diff)
fix vaDestroyImage()
-rw-r--r--i965_drv_video/i965_drv_video.c10
-rw-r--r--i965_drv_video/i965_drv_video.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c
index 6582c71..79faf2e 100644
--- a/i965_drv_video/i965_drv_video.c
+++ b/i965_drv_video/i965_drv_video.c
@@ -1149,7 +1149,8 @@ i965_CreateImage(VADriverContextP ctx,
image->buf = img_buf_id;
image->width = width;
image->height = height;
-
+
+ obj_image->buf = img_buf_id;
obj_image->width = width;
obj_image->height = height;
obj_image->size = subpic_size;
@@ -1178,8 +1179,11 @@ i965_DestroyImage(VADriverContextP ctx, VAImageID image)
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_image *obj_image = IMAGE(image);
- i965_DestroyBuffer(ctx, image);
-
+ if (obj_image && obj_image->buf != VA_INVALID_ID) {
+ i965_DestroyBuffer(ctx, obj_image->buf);
+ obj_image->buf = VA_INVALID_ID;
+ }
+
i965_destroy_image(&i965->image_heap, (struct object_base *)obj_image);
return VA_STATUS_SUCCESS;
diff --git a/i965_drv_video/i965_drv_video.h b/i965_drv_video/i965_drv_video.h
index 1771b0d..0b7ee33 100644
--- a/i965_drv_video/i965_drv_video.h
+++ b/i965_drv_video/i965_drv_video.h
@@ -109,11 +109,13 @@ struct object_buffer
struct object_image
{
struct object_base base;
+ VABufferID buf;
int width;
int height;
int size;
dri_bo *bo;
};
+
struct object_subpic
{
struct object_base base;