From 115f3b1fce812c36feec9da474ec84e909c1d643 Mon Sep 17 00:00:00 2001 From: jojo61 Date: Mon, 16 May 2022 15:13:00 +0200 Subject: [PATCH] Set DISPLAY if not already set. --- softhdcuvid.cpp | 2 +- video.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/softhdcuvid.cpp b/softhdcuvid.cpp index 359a274..1935050 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.5.6" +static const char *const VERSION = "3.6" #ifdef GIT_REV "-GIT" GIT_REV #endif diff --git a/video.c b/video.c index 40256e5..c084606 100644 --- a/video.c +++ b/video.c @@ -3124,7 +3124,7 @@ int get_RGB(CuvidDecoder *decoder) { glActiveTexture(GL_TEXTURE0); } glFlush(); - Debug(3, "Read pixels %d %d\n", width, height); + //Debug(3, "Read pixels %d %d\n", width, height); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); @@ -7022,6 +7022,14 @@ void VideoInit(const char *display_name) { if (!display_name && !(display_name = getenv("DISPLAY"))) { // if no environment variable, use :0.0 as default display name display_name = ":0.0"; + + } + if (!getenv("DISPLAY")) { + //force set DISPLAY environment variable, otherwise nvidia driver + //has problems at libplace-swapchain-init + Debug(3, "video: setting ENV DISPLAY=%s\n",display_name); + setenv("DISPLAY",display_name,0); + //Debug(3, "video: ENV:(%s)\n",getenv("DISPLAY")); } if (!(XlibDisplay = XOpenDisplay(display_name))) {