Enlarge timeline for soundstream when necessary

This commit is contained in:
Jindra Petřík
2022-12-26 23:41:30 +01:00
parent 047ef148ce
commit 308ac701ab
2 changed files with 14 additions and 0 deletions

View File

@@ -292,6 +292,19 @@ public abstract class SoundStreamHeadTypeTag extends Tag implements CharacterIdT
}
}
}
int framesBefore = timelined.getFrameCount();
//enlarge timeline when necessary
while (!blocks.isEmpty()) {
SoundStreamBlockTag block = blocks.remove(0);
block.setTimelined(timelined);
timelined.addTag(block);
ShowFrameTag sft = new ShowFrameTag(swf);
sft.setTimelined(timelined);
timelined.addTag(sft);
framesBefore++;
}
timelined.setFrameCount(framesBefore);
setSoundCompression(newSoundFormat);
setSoundSampleCount((int) newSoundSampleCount);
setSoundSize(newSoundSize);