diff options
author | John Preston <johnprestonmail@gmail.com> | 2023-03-17 21:18:31 +0400 |
---|---|---|
committer | John Preston <johnprestonmail@gmail.com> | 2023-03-17 21:18:56 +0400 |
commit | 2c17f41c61c2fcf2a64760e9ced26266de60b62b (patch) | |
tree | 5e626c1649e5f6fad3a6b4fbd5b1d1b3776da2ac /Telegram/SourceFiles/media/audio/media_audio_loaders.cpp | |
parent | 1f2836af59363b132843b71d3d6fbc05cb3c27fa (diff) |
Beta version 4.6.12: Compare speed values safely.
Diffstat (limited to 'Telegram/SourceFiles/media/audio/media_audio_loaders.cpp')
-rw-r--r-- | Telegram/SourceFiles/media/audio/media_audio_loaders.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp b/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp index 1f5dedd6e4..5cff8167e5 100644 --- a/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp +++ b/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "media/audio/media_audio.h" #include "media/audio/media_audio_ffmpeg_loader.h" #include "media/audio/media_child_ffmpeg_loader.h" +#include "media/media_common.h" namespace Media { namespace Player { @@ -157,7 +158,7 @@ void Loaders::loadData(AudioMsgId audio, crl::time positionMs) { } const auto sampleSize = l->sampleSize(); - const auto speedChanged = (setup.newSpeed != setup.oldSpeed); + const auto speedChanged = !EqualSpeeds(setup.newSpeed, setup.oldSpeed); auto updatedWithSpeed = speedChanged ? rebufferOnSpeedChange(setup) : std::optional<Mixer::Track::WithSpeed>(); @@ -438,7 +439,7 @@ Loaders::SetupLoaderResult Loaders::setupLoader( track->state.length, track->speed); return { .loader = l, .justStarted = true }; - } else if (track->nextSpeed != track->speed) { + } else if (!EqualSpeeds(track->nextSpeed, track->speed)) { return { .loader = l, .oldSpeed = track->speed, |