mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Fixed sf::SoundBuffer returning wrong duration for sounds containing more than ~4.3 million samples
This commit is contained in:
parent
db77b76d91
commit
2ff58edd9a
@ -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<float>(m_samples.size()) / sampleRate / channelCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user