From 94b28b906bef2a41eddbd1be9199730134d4cd6b Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Mon, 24 Mar 2014 09:32:30 +0800 Subject: [PATCH] Destroy the buffer after vaRenderPicture() for encoding It is to match vaRenderPicture() semantics. Note this patch is only used for testing Signed-off-by: Xiang, Haihao --- src/i965_drv_video.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 3ac5418..a95966c 100755 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -1845,8 +1845,6 @@ i965_DestroyBuffer(VADriverContextP ctx, VABufferID buffer_id) struct i965_driver_data *i965 = i965_driver_data(ctx); struct object_buffer *obj_buffer = BUFFER(buffer_id); - assert(obj_buffer); - if (!obj_buffer) return VA_STATUS_ERROR_INVALID_BUFFER; @@ -2144,7 +2142,7 @@ i965_encoder_render_picture(VADriverContextP ctx, for (i = 0; i < num_buffers; i++) { struct object_buffer *obj_buffer = BUFFER(buffers[i]); - assert(obj_buffer); + // assert(obj_buffer); if (!obj_buffer) return VA_STATUS_ERROR_INVALID_BUFFER; @@ -2209,6 +2207,11 @@ i965_encoder_render_picture(VADriverContextP ctx, vaStatus = VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE; break; } + + i965_destroy_buffer(&i965->buffer_heap, (struct object_base *)obj_buffer); + + if (vaStatus != VA_STATUS_SUCCESS) + break; } return vaStatus; -- 1.7.9.5