Commit 141c7a3e authored by Jean-Paul Saman's avatar Jean-Paul Saman

xvba_video_glx.c: fix query_surface_status() to report the true state, also on errors.

Be more strict in checking inside query_surface_status() function. It allowed
for reporting that all is ok on error. The function was therefor not reliable.
parent d50d89d0
......@@ -143,45 +143,50 @@ query_surface_status(
VASurfaceStatus *surface_status
)
{
int status;
int status, ret = -1;
if (!surface_status)
abort(); /* coding error */
if (surface_status)
*surface_status = VASurfaceReady;
if (!obj_surface)
return 0;
return ret;
switch (obj_surface->va_surface_status) {
case VASurfaceRendering: /* Rendering (XvBA level) */
ASSERT(obj_surface->used_for_decoding);
if (!obj_context)
return 0;
return -1;
if (!obj_context->xvba_decoder)
return 0;
return -1;
if (!obj_surface->xvba_surface)
return 0;
return -1;
status = xvba_sync_surface(
obj_context->xvba_decoder,
obj_surface->xvba_surface,
XVBA_GET_SURFACE_STATUS
);
if (status < 0)
return -1;
goto out;
if (status == XVBA_COMPLETED)
obj_surface->va_surface_status = VASurfaceReady;
ret = 0;
break;
case VASurfaceDisplaying:
status = query_surface_status_glx(driver_data, obj_surface);
if (status < 0)
return -1;
goto out;
if (status == XVBA_COMPLETED)
obj_surface->va_surface_status = VASurfaceReady;
ret = 0;
break;
}
out:
if (surface_status)
*surface_status = obj_surface->va_surface_status;
return 0;
return ret;
}
// Synchronize 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