From 6ad192ec39a18aab78396f0c9eba2c9f4aa073e3 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 18 Jan 2025 16:09:05 +0100 Subject: [PATCH] Fix wonky loop info in rare cases --- src/vgmstream.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vgmstream.c b/src/vgmstream.c index e12cf087..3f8ea361 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -113,6 +113,14 @@ bool prepare_vgmstream(VGMSTREAM* vgmstream, STREAMFILE* sf) { vgmstream->stream_index = sf->stream_index; } + //TODO: this should be called in setup_vgmstream sometimes, but hard to detect since it's used for other stuff + /* clean as loops are readable metadata but loop fields may contain garbage + * (done *after* dual stereo as it needs loop fields to match) */ + if (!vgmstream->loop_flag) { + vgmstream->loop_start_sample = 0; + vgmstream->loop_end_sample = 0; + } + setup_vgmstream(vgmstream); /* final setup */