Action list fixes

This commit is contained in:
DataHoarder 2022-01-08 20:29:26 +01:00
parent 54ed3bc110
commit 4dc069e6f5
3 changed files with 8 additions and 2 deletions

View file

@ -96,7 +96,7 @@ class SWFProcessor extends SWFTreeProcessor {
return null;
}
if(!$this->isPlaying() and ($this->audio === null or $this->audio->getStartFrame() === null)){ //Force play till finding audio
if(!$this->isPlaying() and ($this->audio === null or $this->audio->getStartFrame() === null) or $this->getFrame() === 1){ //Force play till finding audio, or first frame is 0
$this->playing = true;
}

View file

@ -200,6 +200,10 @@ class SWFTreeProcessor {
return $this->playing;
}
public function getLoops() : int{
return $this->loops;
}
public function nextFrame(): ?ViewFrame {
$actions = new ActionList();
if(!$this->playing){
@ -216,6 +220,7 @@ class SWFTreeProcessor {
}
if ($nodeName === null) { //Loop again
$this->loops++;
$this->frame = 0;
$this->index = 0;
$this->layout = new ViewLayout($this->layout->getObjectId(), null);

View file

@ -126,7 +126,7 @@ if ($swf->header["signature"]) {
$lastFrame = null;
while(($frame = $processor->nextFrameOutput()) !== null){
$lastFrame = $frame;
if(!$processor->isPlaying()){
if(!$processor->isPlaying() or $processor->getLoops() > 0){
break;
}
$audio = $processor->getAudio();
@ -222,6 +222,7 @@ if ($swf->header["signature"]) {
break;
}
}
foreach ($assRenderer->flush($lastFrame) as $line){
fwrite($fp, $line . "\n");
}