From 2bdc1e9d7cd7f935fd34bbda225fd5d0192b1b69 Mon Sep 17 00:00:00 2001 From: Charles Ray Shisler III Date: Sun, 21 Feb 2016 18:25:36 -0800 Subject: [PATCH 1/2] linux-capture: Fix texture lingering after window closes After source window closes, texture is still visible in preview until the source window opens again. --- plugins/linux-capture/xcompcap-main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/linux-capture/xcompcap-main.cpp b/plugins/linux-capture/xcompcap-main.cpp index d894795c6..8f5d32ea3 100644 --- a/plugins/linux-capture/xcompcap-main.cpp +++ b/plugins/linux-capture/xcompcap-main.cpp @@ -520,6 +520,10 @@ void XCompcapMain::tick(float seconds) void XCompcapMain::render(gs_effect_t *effect) { PLock lock(&p->lock, true); + + if (!p->win) + return; + effect = obs_get_base_effect(OBS_EFFECT_OPAQUE); if (!lock.isLocked() || !p->tex) From 2e642fcc611d9619d3551a29cc493a41990f4206 Mon Sep 17 00:00:00 2001 From: Charles Ray Shisler III Date: Sun, 21 Feb 2016 18:30:21 -0800 Subject: [PATCH 2/2] linux-capture: Remove red background from texture When a source window was not available, a red background was shown instead. This was undesirable, and expected behavior would be for the background to be transparent, enabling what exists behind the source to be shown. --- plugins/linux-capture/xcompcap-main.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/linux-capture/xcompcap-main.cpp b/plugins/linux-capture/xcompcap-main.cpp index 8f5d32ea3..42ecd770f 100644 --- a/plugins/linux-capture/xcompcap-main.cpp +++ b/plugins/linux-capture/xcompcap-main.cpp @@ -354,12 +354,7 @@ void XCompcapMain::updateSettings(obs_data_t *settings) uint8_t *texData = new uint8_t[width() * height() * 4]; - for (unsigned int i = 0; i < width() * height() * 4; i += 4) { - texData[i + 0] = p->swapRedBlue ? 0 : 0xFF; - texData[i + 1] = 0; - texData[i + 2] = p->swapRedBlue ? 0xFF : 0; - texData[i + 3] = 0xFF; - } + memset(texData, 0, width() * height() * 4); const uint8_t* texDataArr[] = { texData, 0 };