Skip to content

Commit

Permalink
Fix lossless capability reporting for partial read
Browse files Browse the repository at this point in the history
When reading partial chunks, and when returning partial data, it is
essential to maintain this lossless chunk status across either whole or
partial chunk reads. Otherwise, the converter chain sees the lossless
flag constantly changing on lossless files, such as PCM or DSD, and
causes the DSD decimator and/or resampler to be torn down and reset
repeatedly, causing glitches in the audio.

The glitch was not, in fact, with the decimator itself, and was
occurring to a degree without it, as it would be restarting the
resampler repeatedly as well.

Fixes #367

Signed-off-by: Christopher Snowhill <[email protected]>
  • Loading branch information
kode54 committed Jul 14, 2023
1 parent ffbc571 commit 323a554
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Audio/Chain/ChunkList.m
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ - (AudioChunk *)removeSamples:(size_t)maxFrameCount {
AudioChunk *ret = [[AudioChunk alloc] init];
[ret setFormat:[chunk format]];
[ret setChannelConfig:[chunk channelConfig]];
[ret setLossless:[chunk lossless]];
[ret assignData:removedData];
listDuration -= [ret duration];
inRemover = NO;
Expand Down Expand Up @@ -510,6 +511,7 @@ - (AudioChunk *)removeSamplesAsFloat32:(size_t)maxFrameCount {
AudioChunk *ret = [[AudioChunk alloc] init];
[ret setFormat:[chunk format]];
[ret setChannelConfig:[chunk channelConfig]];
[ret setLossless:[chunk lossless]];
[ret assignData:removedData];
listDuration -= [ret duration];
inRemover = NO;
Expand Down

0 comments on commit 323a554

Please sign in to comment.