Set stretching of time async

This commit is contained in:
Ylva Selling
2023-02-08 15:04:09 -05:00
parent 33326e29f5
commit a792f5022c
2 changed files with 15 additions and 3 deletions

View File

@@ -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<uint64_t>(LibmpvPropertyKey::Speed),
"speed",
MPV_FORMAT_DOUBLE,
&stretchedTime
);
if (!checkMpvError(result)) {
LWARNING("Error when pausing video");
}
}
}
}

View File

@@ -82,7 +82,8 @@ private:
Command,
Width,
FrameCount,
Pause
Pause,
Speed
};
enum class AnimationMode {