From 1131749e5def193350c7ecc9d7370b901e95d975 Mon Sep 17 00:00:00 2001 From: emb <> Date: Sun, 11 Jan 2015 13:04:59 -0600 Subject: [PATCH] Delete video video texture in main thread to prevent "blip" of displaying old video when highlighting a new item. --- RetroFE/Source/Video/GStreamerVideo.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/RetroFE/Source/Video/GStreamerVideo.cpp b/RetroFE/Source/Video/GStreamerVideo.cpp index b0a1466..3886cf7 100644 --- a/RetroFE/Source/Video/GStreamerVideo.cpp +++ b/RetroFE/Source/Video/GStreamerVideo.cpp @@ -104,12 +104,6 @@ void GStreamerVideo::ProcessNewBuffer (GstElement *fakesink, GstBuffer *buf, Gst if(video->Height && video->Width) { - if(video->Texture && video->VideoBufferSize != map.size) - { - SDL_DestroyTexture(video->Texture); - video->Texture = NULL; - } - // keep the largest video buffer allocated to avoid the penalty of reallocating and deallocating if(!video->VideoBuffer || video->MaxVideoBufferSize < map.size) { @@ -175,6 +169,13 @@ bool GStreamerVideo::Stop() (void)gst_element_set_state(Playbin, GST_STATE_NULL); } + if(Texture) + { + SDL_DestroyTexture(Texture); + Texture = NULL; + } + + // FreeElements(); IsPlaying = false;