Skip to content

Commit

Permalink
[Fix] MED: If an IFFOCT instrument has sample loop information in the…
Browse files Browse the repository at this point in the history
… extra data, the sample loop points must be doubled with each sample, just like with the normal loop data.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22857 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Jan 19, 2025
1 parent cbd92b8 commit 573f176
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions soundlib/Load_med.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1285,15 +1285,19 @@ bool CSoundFile::ReadMED(FileReader &file, ModLoadingFlags loadFlags)
}
#endif // MPT_WITH_VST

loopStart = instrExt.loopStart;
loopEnd = instrExt.loopStart + instrExt.loopLength;
for(SAMPLEINDEX i = 0; i < numSamples; i++)
{
ModSample &sample = Samples[smp + i];
sample.nFineTune = MOD2XMFineTune(instrExt.finetune);

if(!isSynth && size > offsetof(MMDInstrExt, loopLength))
{
sample.nLoopStart = instrExt.loopStart;
sample.nLoopEnd = instrExt.loopStart + instrExt.loopLength;
sample.nLoopStart = loopStart;
sample.nLoopEnd = loopEnd;
loopStart *= 2;
loopEnd *= 2;
}
if(size > offsetof(MMDInstrExt, instrFlags))
{
Expand Down

0 comments on commit 573f176

Please sign in to comment.