[Chunk List Converter] Minor changes
Neither of these two changes is really important, but they do simplify things, and the division on that one function makes the non-decimating DSD support actually functional, as the caller expects a specific number of samples, and that was otherwise octupling the input sample count. Signed-off-by: Christopher Snowhill <kode54@gmail.com>main
parent
d9a09bff40
commit
7e03f423c3
|
@ -486,6 +486,12 @@ static void convert_be_to_le(uint8_t *buffer, size_t bitsPerSample, size_t bytes
|
||||||
return [[AudioChunk alloc] init];
|
return [[AudioChunk alloc] init];
|
||||||
}
|
}
|
||||||
AudioChunk *chunk = [chunkList objectAtIndex:0];
|
AudioChunk *chunk = [chunkList objectAtIndex:0];
|
||||||
|
#if !DSD_DECIMATE
|
||||||
|
AudioStreamBasicDescription asbd = [chunk format];
|
||||||
|
if(asbd.mBitsPerChannel == 1) {
|
||||||
|
maxFrameCount /= 8;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if([chunk frameCount] <= maxFrameCount) {
|
if([chunk frameCount] <= maxFrameCount) {
|
||||||
[chunkList removeObjectAtIndex:0];
|
[chunkList removeObjectAtIndex:0];
|
||||||
listDuration -= [chunk duration];
|
listDuration -= [chunk duration];
|
||||||
|
@ -627,7 +633,7 @@ static void convert_be_to_le(uint8_t *buffer, size_t bitsPerSample, size_t bytes
|
||||||
samplesRead *= 8;
|
samplesRead *= 8;
|
||||||
#endif
|
#endif
|
||||||
bitsPerSample = 32;
|
bitsPerSample = 32;
|
||||||
bytesReadFromInput = samplesRead * inputFormat.mChannelsPerFrame * sizeof(float);
|
bytesReadFromInput = samplesRead * floatFormat.mBytesPerPacket;
|
||||||
isFloat = YES;
|
isFloat = YES;
|
||||||
inputBuffer = &tempData[buffer_adder];
|
inputBuffer = &tempData[buffer_adder];
|
||||||
inputChanged = YES;
|
inputChanged = YES;
|
||||||
|
|
Loading…
Reference in New Issue