Delete video video texture in main thread to prevent "blip" of displaying old video when highlighting a new item.

This commit is contained in:
emb 2015-01-11 13:04:59 -06:00
parent 3ee6663350
commit 1131749e5d

View File

@ -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;