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;