From d5ca73c22f45a02ab26e15c6166923ec6c8aa441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20K=C3=B6nig?= Date: Thu, 11 Jan 2024 10:59:09 +0100 Subject: [PATCH] Fix handling of vaapi filehandles --- softhdcuvid.cpp | 2 +- video.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/softhdcuvid.cpp b/softhdcuvid.cpp index d2ba437..4a5ebe0 100644 --- a/softhdcuvid.cpp +++ b/softhdcuvid.cpp @@ -61,7 +61,7 @@ extern void ToggleLUT(); /// vdr-plugin version number. /// Makefile extracts the version number for generating the file name /// for the distribution archive. -static const char *const VERSION = "3.14" +static const char *const VERSION = "3.15" #ifdef GIT_REV "-GIT" GIT_REV #endif diff --git a/video.c b/video.c index b0b4bc9..fdea40d 100644 --- a/video.c +++ b/video.c @@ -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);