From 64d9f18c39d6dabbbc036b4c50a7120480846da8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 9 May 2016 22:54:07 -0400 Subject: [PATCH] Unbind the graphics context when exiting the stream --- viddec.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/viddec.cpp b/viddec.cpp index f6194eb..f46392e 100644 --- a/viddec.cpp +++ b/viddec.cpp @@ -156,6 +156,7 @@ void MoonlightInstance::VidDecCleanup(void) { g_Instance->m_VideoDecoder->Flush(pp::BlockUntilComplete()); delete g_Instance->m_VideoDecoder; + // Delete shader programs if (g_Instance->m_Texture2DShader.program) { glDeleteProgram(g_Instance->m_Texture2DShader.program); g_Instance->m_Texture2DShader.program = 0; @@ -168,6 +169,11 @@ void MoonlightInstance::VidDecCleanup(void) { glDeleteProgram(g_Instance->m_ExternalOesShader.program); g_Instance->m_ExternalOesShader.program = 0; } + + // Unbind graphics device by binding a default constructed object + glSetCurrentContextPPAPI(0); + g_Instance->m_Graphics3D = pp::Graphics3D(); + g_Instance->BindGraphics(g_Instance->m_Graphics3D); } static void ProcessSpsNalu(unsigned char* data, int length) {