diff --git a/modules/globebrowsing/src/tileprovider/videotileprovider.cpp b/modules/globebrowsing/src/tileprovider/videotileprovider.cpp index 0eb405eba5..a72e4c391d 100644 --- a/modules/globebrowsing/src/tileprovider/videotileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/videotileprovider.cpp @@ -499,8 +499,19 @@ void VideoTileProvider::updateStretchingOfTime() { } else { double stretchedTime = (_endJ200Time - _startJ200Time) / deltaTime; // seconds - std::string stringStretch = std::to_string(_videoDuration / stretchedTime); - setPropertyStringMpv("speed", stringStretch.c_str()); // TODO: Make async + if (stretchedTime > 0.0) { + int result = mpv_set_property_async( + _mpvHandle, + static_cast(LibmpvPropertyKey::Speed), + "speed", + MPV_FORMAT_DOUBLE, + &stretchedTime + ); + if (!checkMpvError(result)) { + LWARNING("Error when pausing video"); + } + } + } } diff --git a/modules/globebrowsing/src/tileprovider/videotileprovider.h b/modules/globebrowsing/src/tileprovider/videotileprovider.h index ba6f30c041..3543f394a3 100644 --- a/modules/globebrowsing/src/tileprovider/videotileprovider.h +++ b/modules/globebrowsing/src/tileprovider/videotileprovider.h @@ -82,7 +82,8 @@ private: Command, Width, FrameCount, - Pause + Pause, + Speed }; enum class AnimationMode {