Skip to content

Commit

Permalink
Merge pull request #295 from philipl/ffmpeg-surface-count
Browse files Browse the repository at this point in the history
vabackend: Treat surfaceCount == 1 the same as surfaceCount == 0
  • Loading branch information
elFarto authored May 10, 2024
2 parents b810245 + 8a69f9a commit f3205bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vabackend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,12 +1043,12 @@ static VAStatus nvCreateContext(
cfg->bitDepth = surface->bitDepth;
}

if (drv->surfaceCount == 0 && num_render_targets == 0) {
LOG("0 surfaces have been passed to vaCreateContext, this might cause errors. Setting surface count to 32");
if (drv->surfaceCount <= 1 && num_render_targets == 0) {
LOG("0/1 surfaces have been passed to vaCreateContext, this might cause errors. Setting surface count to 32");
num_render_targets = 32;
}

int surfaceCount = drv->surfaceCount != 0 ? drv->surfaceCount : num_render_targets;
int surfaceCount = drv->surfaceCount > 1 ? drv->surfaceCount : num_render_targets;
if (surfaceCount > 32) {
LOG("Application requested %d surface(s), limiting to 32. This may cause issues.", surfaceCount);
surfaceCount = 32;
Expand Down

0 comments on commit f3205bd

Please sign in to comment.