From a412ee8b4295245815cccf79162c2e4dcd2729ac Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Thu, 26 Apr 2018 09:55:20 +0200 Subject: [PATCH] picture: Always sync surface in EndPicture The libVA API expects rendering to be done after calling EndPicture. Since SyncSurface calls are generally not issued in a way compatible with dequeuing buffers (they might be called too early or too late), always call SyncSurface from EndPicture. Signed-off-by: Paul Kocialkowski --- src/picture.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/picture.c b/src/picture.c index d7467e9..f9c559b 100644 --- a/src/picture.c +++ b/src/picture.c @@ -141,6 +141,7 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context, unsigned int control_size; unsigned int control_id; int request_fd; + VAStatus status; int rc; context_object = CONTEXT(context_id); @@ -193,6 +194,10 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context, surface_object->slices_size = 0; + status = SunxiCedrusSyncSurface(context, context_object->render_surface_id); + if (status != VA_STATUS_SUCCESS) + return status; + context_object->render_surface_id = VA_INVALID_ID; return VA_STATUS_SUCCESS;