From a3e048232e13a09cc64abda78f0ff974549d0a98 Mon Sep 17 00:00:00 2001 From: Ylva Selling Date: Tue, 4 Oct 2022 12:07:20 -0400 Subject: [PATCH] Make reset button work (it restarts the video from the beginning) --- .../src/tileprovider/ffmpegtileprovider.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/globebrowsing/src/tileprovider/ffmpegtileprovider.cpp b/modules/globebrowsing/src/tileprovider/ffmpegtileprovider.cpp index 76839d9156..7dd1b0e730 100644 --- a/modules/globebrowsing/src/tileprovider/ffmpegtileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/ffmpegtileprovider.cpp @@ -311,10 +311,9 @@ void FfmpegTileProvider::reset() { if (_videoFile.empty()) { return; } - - // TODO: This should probalby be repolaced with a call to internal - // initialize when that is fixed _tileIsReady = false; + internalDeinitialize(); + internalInitialize(); } @@ -411,6 +410,10 @@ void FfmpegTileProvider::internalInitialize() { FfmpegTileProvider::~FfmpegTileProvider() { // TODO: Check so internalDeinitialize is called after the last // update function and move code there + +} + +void FfmpegTileProvider::internalDeinitialize() { avformat_close_input(&_formatContext); av_free(_avFrame); av_free(_glFrame); @@ -418,8 +421,4 @@ FfmpegTileProvider::~FfmpegTileProvider() { avformat_free_context(_formatContext); } -void FfmpegTileProvider::internalDeinitialize() { - -} - } // namespace openspace::globebrowsing