From badcfb0fe90eb9e47cd07b10e8fa7e32d82225c9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 22 Jun 2021 18:17:06 +0200 Subject: [PATCH] Fixed a glitch in VideoFFmpegComponent as the video texture was not properly reset. --- es-core/src/components/VideoFFmpegComponent.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/VideoFFmpegComponent.cpp b/es-core/src/components/VideoFFmpegComponent.cpp index 79b70e9ec..dff5742b9 100644 --- a/es-core/src/components/VideoFFmpegComponent.cpp +++ b/es-core/src/components/VideoFFmpegComponent.cpp @@ -42,14 +42,11 @@ VideoFFmpegComponent::VideoFFmpegComponent( mDecodedFrame(false), mEndOfVideo(false) { - // Get an empty texture for rendering the video. - mTexture = TextureResource::get(""); } VideoFFmpegComponent::~VideoFFmpegComponent() { stopVideo(); - mTexture.reset(); } void VideoFFmpegComponent::setResize(float width, float height) @@ -831,6 +828,9 @@ void VideoFFmpegComponent::startVideo() mAudioFrameCount = 0; mOutputPicture = {}; + // Get an empty texture for rendering the video. + mTexture = TextureResource::get(""); + // This is used for the audio and video synchronization. mTimeReference = std::chrono::high_resolution_clock::now(); @@ -983,6 +983,7 @@ void VideoFFmpegComponent::stopVideo() mStartDelayed = false; mPause = false; mEndOfVideo = false; + mTexture.reset(); if (mFrameProcessingThread) { if (mWindow->getVideoPlayerCount() == 0)