From 2ac9741ef29a2546471ea9cd48c0ac7fdc421c1f Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 21 Jul 2023 00:10:13 -0700 Subject: [PATCH] CUE: Round up bits per sample Round bits per sample to an even byte. Signed-off-by: Christopher Snowhill --- Plugins/CueSheet/CueSheetDecoder.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/CueSheet/CueSheetDecoder.m b/Plugins/CueSheet/CueSheetDecoder.m index 6aab78079..99f680fc8 100644 --- a/Plugins/CueSheet/CueSheetDecoder.m +++ b/Plugins/CueSheet/CueSheetDecoder.m @@ -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;