Commit 932670e0 authored by Jean-Paul Saman's avatar Jean-Paul Saman

object_heap_allocate() returns an int and not an VA_INVALID_ID.

parent 776cc2d7
...@@ -195,7 +195,7 @@ create_va_buffer( ...@@ -195,7 +195,7 @@ create_va_buffer(
object_buffer_p obj_buffer; object_buffer_p obj_buffer;
buffer_id = object_heap_allocate(&driver_data->buffer_heap); buffer_id = object_heap_allocate(&driver_data->buffer_heap);
if (buffer_id == VA_INVALID_BUFFER) if (buffer_id == -1)
return NULL; return NULL;
obj_buffer = XVBA_BUFFER(buffer_id); obj_buffer = XVBA_BUFFER(buffer_id);
......
...@@ -292,7 +292,7 @@ create_image( ...@@ -292,7 +292,7 @@ create_image(
) )
{ {
VAImageID image_id = object_heap_allocate(&driver_data->image_heap); VAImageID image_id = object_heap_allocate(&driver_data->image_heap);
if (image_id == VA_INVALID_ID) if (image_id == -1)
return NULL; return NULL;
object_image_p obj_image = XVBA_IMAGE(image_id); object_image_p obj_image = XVBA_IMAGE(image_id);
...@@ -435,6 +435,7 @@ commit_hw_image( ...@@ -435,6 +435,7 @@ commit_hw_image(
unsigned int flags unsigned int flags
) )
{ {
/* FIXME: this function 'leaks memory' when used with subpictures */
VAStatus status; VAStatus status;
object_buffer_p const obj_buffer = XVBA_BUFFER(obj_image->image.buf); object_buffer_p const obj_buffer = XVBA_BUFFER(obj_image->image.buf);
...@@ -462,6 +463,7 @@ commit_hw_image( ...@@ -462,6 +463,7 @@ commit_hw_image(
if (status != VA_STATUS_SUCCESS) if (status != VA_STATUS_SUCCESS)
return status; return status;
} }
ASSERT(hw_image_hooks_glx.create);
ASSERT(hw_image_hooks_glx.commit); ASSERT(hw_image_hooks_glx.commit);
status = hw_image_hooks_glx.commit( status = hw_image_hooks_glx.commit(
driver_data, driver_data,
......
...@@ -272,7 +272,7 @@ create_subpicture( ...@@ -272,7 +272,7 @@ create_subpicture(
{ {
VASubpictureID subpic_id; VASubpictureID subpic_id;
subpic_id = object_heap_allocate(&driver_data->subpicture_heap); subpic_id = object_heap_allocate(&driver_data->subpicture_heap);
if (subpic_id == VA_INVALID_ID) if (subpic_id == -1)
return NULL; return NULL;
object_subpicture_p obj_subpicture = XVBA_SUBPICTURE(subpic_id); object_subpicture_p obj_subpicture = XVBA_SUBPICTURE(subpic_id);
......
...@@ -385,7 +385,7 @@ xvba_CreateConfig( ...@@ -385,7 +385,7 @@ xvba_CreateConfig(
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE; return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
configID = object_heap_allocate(&driver_data->config_heap); configID = object_heap_allocate(&driver_data->config_heap);
if (configID == VA_INVALID_ID) if (configID == -1)
return VA_STATUS_ERROR_ALLOCATION_FAILED; return VA_STATUS_ERROR_ALLOCATION_FAILED;
obj_config = XVBA_CONFIG(configID); obj_config = XVBA_CONFIG(configID);
if (!obj_config) if (!obj_config)
...@@ -492,6 +492,8 @@ xvba_CreateSurfaces( ...@@ -492,6 +492,8 @@ xvba_CreateSurfaces(
for (i = 0; i < num_surfaces; i++) { for (i = 0; i < num_surfaces; i++) {
int va_surface = object_heap_allocate(&driver_data->surface_heap); int va_surface = object_heap_allocate(&driver_data->surface_heap);
if (va_surface == -1)
return VA_STATUS_ERROR_ALLOCATION_FAILED;
object_surface_p obj_surface = XVBA_SURFACE(va_surface); object_surface_p obj_surface = XVBA_SURFACE(va_surface);
if (!obj_surface) { if (!obj_surface) {
va_status = VA_STATUS_ERROR_ALLOCATION_FAILED; va_status = VA_STATUS_ERROR_ALLOCATION_FAILED;
...@@ -642,6 +644,8 @@ xvba_CreateContext( ...@@ -642,6 +644,8 @@ xvba_CreateContext(
} }
VAContextID context_id = object_heap_allocate(&driver_data->context_heap); VAContextID context_id = object_heap_allocate(&driver_data->context_heap);
if (context_id == -1)
return VA_STATUS_ERROR_ALLOCATION_FAILED;
object_context_p const obj_context = XVBA_CONTEXT(context_id); object_context_p const obj_context = XVBA_CONTEXT(context_id);
if (!obj_context) if (!obj_context)
return VA_STATUS_ERROR_ALLOCATION_FAILED; return VA_STATUS_ERROR_ALLOCATION_FAILED;
......
...@@ -38,7 +38,7 @@ output_surface_create( ...@@ -38,7 +38,7 @@ output_surface_create(
) )
{ {
VASurfaceID surface = object_heap_allocate(&driver_data->output_heap); VASurfaceID surface = object_heap_allocate(&driver_data->output_heap);
if (surface == VA_INVALID_ID) if (surface == -1)
return NULL; return NULL;
object_output_p obj_output = XVBA_OUTPUT(surface); object_output_p obj_output = XVBA_OUTPUT(surface);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment