From 0b243158a01620cdf87c90e11051c5f873658bd2 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 1 Feb 2022 23:54:54 -0800 Subject: [PATCH] Cue Sheet input: Fix files with no length This bug prevented zero length or unknown length files, such as FLAC files with no sample count in the header, or audio streams, from playing properly, and clipped their output to the 0 samples indicated by the field. Now it will simply allow wrapped files to decode until they stop producing output. 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 53b4f8273..1ed4ed52f 100644 --- a/Plugins/CueSheet/CueSheetDecoder.m +++ b/Plugins/CueSheet/CueSheetDecoder.m @@ -243,7 +243,7 @@ - (long)seek:(long)frame { - if (frame > trackEnd - trackStart) { + if (!noFragment && frame > trackEnd - trackStart) { //need a better way of returning fail. return -1; } @@ -257,7 +257,7 @@ - (int)readAudio:(void *)buf frames:(UInt32)frames { - if (framePosition + frames > trackEnd) { + if (!noFragment && framePosition + frames > trackEnd) { frames = (UInt32)(trackEnd - framePosition); }