Make reset button work (it restarts the video from the beginning)

This commit is contained in:
Ylva Selling
2022-10-04 12:07:20 -04:00
parent fa30188e44
commit a3e048232e

View File

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