Skip to content

Commit

Permalink
Allow invaid surface to be passed as reference surface
Browse files Browse the repository at this point in the history
The driver handles this case and runs other filters if references are
not supplied properly. This is better than falling back to the
unprocessed surface. The fallback is done in other error cases though.
  • Loading branch information
pesintta committed Mar 3, 2018
1 parent 645c71b commit 19e1101
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,9 @@ static VAStatus VaapiPostprocessSurface(VAContextID ctx, VASurfaceID src, VASurf

/* Skip postprocessing if queue is not deinterlaceable */
for (i = 0; i < *num_brefs; ++i) {
// Trust the driver to "do the right thing" if invalid surfaces are provided as references
if (brefs[i] == VA_INVALID_ID)
continue;
va_status = vaQuerySurfaceStatus(VaDisplay, brefs[i], &va_surf_status);
if (va_status != VA_STATUS_SUCCESS) {
Error("vaapi/vpp: Surface %d query status failed (0x%X): %s", i, va_status, vaErrorStr(va_status));
Expand All @@ -1634,6 +1637,9 @@ static VAStatus VaapiPostprocessSurface(VAContextID ctx, VASurfaceID src, VASurf
}

for (i = 0; i < *num_frefs; ++i) {
// Trust the driver to "do the right thing" if invalid surfaces are provided as references
if (frefs[i] == VA_INVALID_ID)
continue;
va_status = vaQuerySurfaceStatus(VaDisplay, frefs[i], &va_surf_status);
if (va_status != VA_STATUS_SUCCESS) {
Error("Surface %d query status = 0x%X: %s", i, va_status, vaErrorStr(va_status));
Expand Down

0 comments on commit 19e1101

Please sign in to comment.