Fix handling of vaapi filehandles

This commit is contained in:
Joachim König
2024-01-11 10:59:09 +01:00
parent 6704b2ca5a
commit d5ca73c22f
2 changed files with 11 additions and 2 deletions

11
video.c
View File

@@ -2611,7 +2611,16 @@ void generateVAAPIImage(CuvidDecoder *decoder, VASurfaceID index, const AVFrame
glBindTexture(GL_TEXTURE_2D, decoder->gl_textures[index * Planes + n]);
EGLImageTargetTexture2DOES(GL_TEXTURE_2D, decoder->images[index * Planes + n]);
decoder->fds[index * Planes + n] = desc.objects[n].fd;
if (n==0) {
decoder->fds[index * Planes + n] = fd;
}
else if (fd == decoder->fds[index * Planes]) {
decoder->fds[index * Planes + n] = 0;
}
else {
decoder->fds[index * Planes + n] = fd;
}
}
glBindTexture(GL_TEXTURE_2D, 0);