1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Code review

This commit is contained in:
Laserlicht
2024-01-25 20:49:59 +01:00
committed by GitHub
parent e3acb92863
commit 3b9372c51c
3 changed files with 16 additions and 16 deletions

View File

@@ -200,11 +200,7 @@ double CSoundHandler::getSoundDuration(const AudioPath & sound)
SDL_FreeWAV(audioBuf);
uint32_t sampleSize = SDL_AUDIO_BITSIZE(spec.format) / 8;
uint32_t sampleCount = audioLen / sampleSize;
uint32_t sampleLen = 0;
if(spec.channels)
sampleLen = sampleCount / spec.channels;
else
sampleLen = sampleCount;
uint32_t sampleLen = sampleCount / spec.channels;
seconds = (double)sampleLen / (double)spec.freq;
}