From: <sv...@op...> - 2025-02-08 15:53:16
|
Author: sagamusix Date: Sat Feb 8 16:53:09 2025 New Revision: 22869 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22869 Log: [Imp] BRR: Relax file rejection heuristics a bit for files that only set the loop bit for frames that are inside the loop (https://bugs.openmpt.org/view.php?id=1859). Modified: trunk/OpenMPT/soundlib/SampleFormatBRR.cpp Modified: trunk/OpenMPT/soundlib/SampleFormatBRR.cpp ============================================================================== --- trunk/OpenMPT/soundlib/SampleFormatBRR.cpp Fri Feb 7 23:23:14 2025 (r22868) +++ trunk/OpenMPT/soundlib/SampleFormatBRR.cpp Sat Feb 8 16:53:09 2025 (r22869) @@ -87,7 +87,14 @@ if(isLast != file.EndOfFile()) return false; if(!first && enableLoop != isLoop) - return false; + { + if(!hasLoopInfo) + return false; + // In some files, the loop flag is only set for the blocks within the loop (except for the first block?) + const bool inLoop = file.GetPosition() > loopStart + 11u; + if(enableLoop != inLoop) + return false; + } // While a range of 13 is technically invalid as well, it can be found in the wild. if(range > 13) return false; |