CUE: Round up bits per sample

Round bits per sample to an even byte.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2023-07-21 00:10:13 -07:00
parent 8ad84c3aed
commit 37fc054739
No known key found for this signature in database

View file

@ -165,7 +165,7 @@ static void *kCueSheetDecoderContext = &kCueSheetDecoderContext;
int channels = [[properties objectForKey:@"channels"] intValue];
float sampleRate = [[properties objectForKey:@"sampleRate"] floatValue];
bytesPerFrame = (bitsPerSample / 8) * channels;
bytesPerFrame = ((bitsPerSample + 7) / 8) * channels;
double _trackStart = [track time];
if(![track timeInSamples]) _trackStart *= sampleRate;
@ -195,7 +195,7 @@ static void *kCueSheetDecoderContext = &kCueSheetDecoderContext;
int bitsPerSample = [[properties objectForKey:@"bitsPerSample"] intValue];
int channels = [[properties objectForKey:@"channels"] intValue];
bytesPerFrame = (bitsPerSample / 8) * channels;
bytesPerFrame = ((bitsPerSample + 7) / 8) * channels;
trackStart = 0;