Skip to content

Commit

Permalink
[Imp] BRR: Relax file rejection heuristics a bit for files that only …
Browse files Browse the repository at this point in the history
…set the loop bit for frames that are inside the loop (https://bugs.openmpt.org/view.php?id=1859).

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22869 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Feb 8, 2025
1 parent 8b910c6 commit d8d8bd8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion soundlib/SampleFormatBRR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ bool CSoundFile::ReadBRRSample(SAMPLEINDEX sample, FileReader &file)
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;
Expand Down

0 comments on commit d8d8bd8

Please sign in to comment.