diff --git a/CHANGELOG.md b/CHANGELOG.md index cd367914e..43ec1c2ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. - Flash viewer - is visible flag - Flash viewer - linear colorspace radial gradient - Folder preview of frames with time increasing +- Flash viewer - Do not play StartSoundTag all over again on single frame ### Changed - [#1661] Slow rendering warning is optional with default to not display diff --git a/libsrc/ffdec_lib/testdata/graphics/POOL-Pool_Shot-709343898.wav b/libsrc/ffdec_lib/testdata/graphics/POOL-Pool_Shot-709343898.wav new file mode 100644 index 000000000..cc2847e47 Binary files /dev/null and b/libsrc/ffdec_lib/testdata/graphics/POOL-Pool_Shot-709343898.wav differ diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics.swf b/libsrc/ffdec_lib/testdata/graphics/graphics.swf index 6394bb7d8..634a429dd 100644 Binary files a/libsrc/ffdec_lib/testdata/graphics/graphics.swf and b/libsrc/ffdec_lib/testdata/graphics/graphics.swf differ diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml index e88ffd4bc..d177fe515 100644 --- a/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml @@ -1,11 +1,12 @@ - + + @@ -30,7 +31,7 @@ - + @@ -44,7 +45,7 @@ - + @@ -160,7 +161,7 @@ - + @@ -240,10 +241,10 @@ + - @@ -772,10 +773,10 @@ !3980 1990|2980 1990!2980 1990|2980 990!2980 990|3980 990!3980 990|3980 1990"/> - + @@ -1374,18 +1375,18 @@ - + - - + + @@ -2095,9 +2096,30 @@ + + + + + + + + + + + + + + + + + + + + + - + @@ -3353,6 +3375,57 @@ + + + + + + + + + 056 Sound + + + + + + + + + + + + + + + + + 057 Sound loop 2 + + + + + + + + + + + + + + + + + 058 Sound envelope + + + + + + + + diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/POOL-Pool_Shot-709343898.wav b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/POOL-Pool_Shot-709343898.wav new file mode 100644 index 000000000..cc2847e47 Binary files /dev/null and b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/POOL-Pool_Shot-709343898.wav differ diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml index 12601412c..a2842583e 100644 --- a/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml +++ b/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml @@ -5,8 +5,8 @@ xmlns:xmp="http://ns.adobe.com/xap/1.0/"> Adobe Flash Professional CS6 - build 481 2021-03-14T08:29:20+01:00 - 2021-03-21T17:38:19+01:00 - 2021-03-21T17:38:19+01:00 + 2021-03-23T18:33:42+01:00 + 2021-03-23T18:33:42+01:00 @@ -15,7 +15,7 @@ - xmp.iid:F561DAD7638AEB1194808358E2C66B7A + xmp.iid:875CB1E9FD8BEB11AEBE9CDB97D5B601 xmp.did:D6D3FE199784EB1187FEAE6972EC5115 xmp.did:D6D3FE199784EB1187FEAE6972EC5115 @@ -74,6 +74,12 @@ 2021-03-14T08:29:20+01:00 Adobe Flash Professional CS6 - build 481 + + created + xmp.iid:875CB1E9FD8BEB11AEBE9CDB97D5B601 + 2021-03-14T08:29:20+01:00 + Adobe Flash Professional CS6 - build 481 + diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/M 5 1616520759.dat b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/M 5 1616520759.dat new file mode 100644 index 000000000..6b5874134 Binary files /dev/null and b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/M 5 1616520759.dat differ diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache index 5123289e6..b46ec6d29 100644 Binary files a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache and b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache differ diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index 5cb437549..915b6aad8 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -110,6 +110,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { private volatile Timer timer; private int frame = -1; + private int prevFrame = -1; private boolean loop; @@ -1437,6 +1438,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { this.frame = 0; this.stillFrame = false; } + this.prevFrame = -1; loaded = true; @@ -1849,9 +1851,15 @@ public final class ImagePanel extends JPanel implements MediaDisplay { lastMouseEvent = this.lastMouseEvent; } + boolean shownAgain = false; + synchronized (ImagePanel.class) { frame = this.frame; time = this.time; + if (this.frame == this.prevFrame) { + shownAgain = true; + } + this.prevFrame = this.frame; cursorPosition = this.cursorPosition; if (cursorPosition != null) { cursorPosition = iconPanel.toImagePoint(cursorPosition); @@ -1917,26 +1925,28 @@ public final class ImagePanel extends JPanel implements MediaDisplay { } } - List sounds = new ArrayList<>(); - List soundClasses = new ArrayList<>(); - timeline.getSounds(frame, time, renderContext.mouseOverButton, mouseButton, sounds, soundClasses); - for (int cid : swf.getCharacters().keySet()) { - CharacterTag c = swf.getCharacter(cid); - for (String cls : soundClasses) { - if (cls.equals(c.getClassName())) { - sounds.add(cid); + if (!shownAgain) { + List sounds = new ArrayList<>(); + List soundClasses = new ArrayList<>(); + timeline.getSounds(frame, time, renderContext.mouseOverButton, mouseButton, sounds, soundClasses); + for (int cid : swf.getCharacters().keySet()) { + CharacterTag c = swf.getCharacter(cid); + for (String cls : soundClasses) { + if (cls.equals(c.getClassName())) { + sounds.add(cid); + } } } - } - for (int sndId : sounds) { - CharacterTag c = swf.getCharacter(sndId); - if (c instanceof SoundTag) { - SoundTag st = (SoundTag) c; - playSound(st, null, thisTimer); + for (int sndId : sounds) { + CharacterTag c = swf.getCharacter(sndId); + if (c instanceof SoundTag) { + SoundTag st = (SoundTag) c; + playSound(st, null, thisTimer); + } } + executeFrame(frame); } - executeFrame(frame); } catch (Throwable ex) { // swf was closed during the rendering probably return; @@ -2070,6 +2080,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { Timeline timeline = timelined.getTimeline(); if (!stillFrame && frame == timeline.getFrameCount() - 1) { frame = 0; + prevFrame = -1; } startTimer(timeline, true); @@ -2236,6 +2247,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { @Override public synchronized void rewind() { frame = 0; + prevFrame = -1; fireMediaDisplayStateChanged(); } @@ -2267,6 +2279,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { } this.frame = frame; + this.prevFrame = -1; stopInternal(); redraw(); fireMediaDisplayStateChanged();