Commit d51c4dcc authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/xvba_video.c: partially revert "rewrite sync_surface"

On some 1080 movies the commit-id: 42be4519
gave issues. Reverting some parts of this commit solves this issue.
parent 14916279
......@@ -149,7 +149,7 @@ query_surface_status(
if (!surface_status)
abort(); /* coding error */
*surface_status = 0;
*surface_status = VASurfaceReady;
if (!obj_surface)
abort(); /* coding error */
......@@ -157,11 +157,11 @@ query_surface_status(
case VASurfaceRendering: /* Rendering (XvBA level) */
ASSERT(obj_surface->used_for_decoding);
if (!obj_context)
goto ok; /* Can be called with obj_context = NULL */
return 0; /* Can be called with obj_context = NULL */
if (!obj_context->xvba_decoder)
abort(); /* coding error */
if (!obj_surface->xvba_surface)
goto ok;;
return 0;
status = xvba_sync_surface(
obj_context->xvba_decoder,
obj_surface->xvba_surface,
......@@ -184,17 +184,13 @@ query_surface_status(
* in both cases it is safe to be used. */
if ((obj_surface->va_surface_status == 0) ||
(obj_surface->va_surface_status == VASurfaceSkipped)) {
goto ok;
return 0;
}
break;
}
*surface_status = obj_surface->va_surface_status;
return 0;
ok: /* State is safe to continue surface is not used for decoding */
*surface_status = VASurfaceReady;
return 0;
}
// Synchronize surface
......@@ -207,11 +203,9 @@ sync_surface(
{
VASurfaceStatus surface_status;
int status;
do {
status = query_surface_status(driver_data, obj_context, obj_surface, &surface_status);
while ((status = query_surface_status(driver_data, obj_context, obj_surface, &surface_status)) == 0 &&
surface_status != VASurfaceReady)
delay_usec(XVBA_SYNC_DELAY);
} while(surface_status != VASurfaceReady && status != 0);
return status;
}
......
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