From 2ff58edd9af5530afa0a58657c0908855c96ce21 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Fri, 11 Oct 2013 19:21:31 +0200 Subject: [PATCH] Fixed sf::SoundBuffer returning wrong duration for sounds containing more than ~4.3 million samples --- src/SFML/Audio/SoundBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFML/Audio/SoundBuffer.cpp b/src/SFML/Audio/SoundBuffer.cpp index 406a9fe66..cfd1c6ac5 100644 --- a/src/SFML/Audio/SoundBuffer.cpp +++ b/src/SFML/Audio/SoundBuffer.cpp @@ -253,7 +253,7 @@ bool SoundBuffer::update(unsigned int channelCount, unsigned int sampleRate) alCheck(alBufferData(m_buffer, format, &m_samples[0], size, sampleRate)); // Compute the duration - m_duration = milliseconds(1000 * m_samples.size() / sampleRate / channelCount); + m_duration = seconds(static_cast(m_samples.size()) / sampleRate / channelCount); return true; }