[PATCH] Don't use magic numbers for float and short sizes

Thanks Alug
This commit is contained in:
NepDisk 2025-11-14 10:32:49 -05:00
parent 7f493e69d1
commit 5f99c77bcd

View file

@ -398,11 +398,11 @@ static boolean I_QueueNextSample(boolean unqueue)
if (sample_format == Float)
{
count = sf_read_float(audio.musicstream, (float *)stream, BUFFERSIZE) * 4; // float is 4 bytes not 2, so just double this shit for now kek
count = sf_read_float(audio.musicstream, (float *)stream, BUFFERSIZE) * sizeof(float); // float is 4 bytes not 2, so just double this shit for now kek
}
else
{
count = sf_read_short(audio.musicstream, stream, BUFFERSIZE) * 2;
count = sf_read_short(audio.musicstream, (short *)stream, BUFFERSIZE) * sizeof(short);
}
if (count == 0)