fix rounding error #447

pull/613/head
Mikael Finstad 6 years ago
parent 429924678c
commit 90faeb11ce

@ -1110,8 +1110,9 @@ const App = memo(() => {
if (!playing) { if (!playing) {
video.play(); video.play();
} else { } else {
const newRate = clamp(video.playbackRate + (dir * 0.15), 0.1, 16); // https://github.com/mifi/lossless-cut/issues/447#issuecomment-766339083
toast.fire({ title: `${i18n.t('Playback rate:')} ${Math.floor(newRate * 100)}%`, timer: 1000 }); const newRate = clamp(Math.round((video.playbackRate + (dir * 0.15)) * 100) / 100, 0.1, 16);
toast.fire({ title: `${i18n.t('Playback rate:')} ${Math.round(newRate * 100)}%`, timer: 1000 });
video.playbackRate = newRate; video.playbackRate = newRate;
} }
}, [playing, canvasPlayerEnabled]); }, [playing, canvasPlayerEnabled]);

Loading…
Cancel
Save