From 16e9ae131d1699c8900861ee67e904f48dac3001 Mon Sep 17 00:00:00 2001 From: vittorioromeo Date: Sun, 16 Jun 2024 20:19:50 +0200 Subject: [PATCH] Fix poor `setPlayingOffset` precision (missing `float` conversion) --- src/SFML/Audio/SoundStream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 47115e23e..557c0a5d8 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -158,7 +158,7 @@ struct SoundStream::Impl : priv::MiniaudioUtils::SoundBase if (impl.sampleRate != 0) { - owner->onSeek(seconds(static_cast(frameIndex / impl.sampleRate))); + owner->onSeek(seconds(static_cast(frameIndex) / static_cast(impl.sampleRate))); } else { @@ -360,7 +360,7 @@ void SoundStream::setPlayingOffset(Time timeOffset) m_impl->sampleBufferCursor = 0; m_impl->samplesProcessed = frameIndex * m_impl->channelCount; - onSeek(seconds(static_cast(frameIndex / m_impl->sampleRate))); + onSeek(seconds(static_cast(frameIndex) / static_cast(m_impl->sampleRate))); }