From d8dc85109bcda811efdaaf9e1ec4c5813803c7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 9 Aug 2025 15:38:12 +0200 Subject: [PATCH] Fixed: #2503 Exporting sound streams as FLV Fixed: Exporting sound streams at all in nightly --- CHANGELOG.md | 2 ++ .../decompiler/flash/exporters/SoundExporter.java | 2 +- src/com/jpexs/decompiler/flash/gui/MainPanel.java | 9 +++++---- .../jpexs/decompiler/flash/gui/TreeNodeType.java | 1 + .../flash/gui/graphics/soundstreamrange16.png | Bin 0 -> 643 bytes .../flash/gui/graphics/soundstreamrange32.png | Bin 0 -> 729 bytes .../flash/gui/tagtree/AbstractTagTree.java | 12 ++++++------ 7 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange16.png create mode 100644 src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange32.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 047952cb4..836d41750 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ All notable changes to this project will be documented in this file. - Configuration TOML file encoding (UTF-8) - [#2496] Fonts - adding characters - truncating too wide advance widths - [#2498] Public traits with same name were not distinguishable +- [#2503] Exporting sound streams as FLV ### Changed - Icon of "Deobfuscation options" menu from pile of pills to medkit @@ -3961,6 +3962,7 @@ Major version of SWF to XML export changed to 2. [#116]: https://www.free-decompiler.com/flash/issues/116 [#2496]: https://www.free-decompiler.com/flash/issues/2496 [#2498]: https://www.free-decompiler.com/flash/issues/2498 +[#2503]: https://www.free-decompiler.com/flash/issues/2503 [#2476]: https://www.free-decompiler.com/flash/issues/2476 [#2404]: https://www.free-decompiler.com/flash/issues/2404 [#1418]: https://www.free-decompiler.com/flash/issues/1418 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java index 2da941263..c8a02b2ad 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/SoundExporter.java @@ -191,7 +191,7 @@ public class SoundExporter { FLVOutputStream flv = new FLVOutputStream(fos); flv.writeHeader(true, false); - int ms = (int) (1000.0 / ((Tag) st).getSwf().frameRate); + int ms = (int) (1000.0 / sh.getSwf().frameRate); for (int b = 0; b < blocks.size(); b++) { byte[] data = blocks.get(b).streamSoundData.getRangeData(); if (st.getSoundFormatId() == 2) { //MP3 diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 21962a2ac..5ee039b7c 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -2178,6 +2178,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se if (nodeType == TreeNodeType.SOUND) { sounds.add((SoundTag) d); } + if (nodeType == TreeNodeType.SOUND_STREAM_RANGE) { + sounds.add((SoundStreamFrameRange) d); + } if (nodeType == TreeNodeType.BINARY_DATA) { binaryData.add((BinaryDataInterface) d); } @@ -2189,10 +2192,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } else if (nodeType == TreeNodeType.FONT) { fonts.add((Tag) d); } - if (nodeType == TreeNodeType.OTHER_TAG) { - if (d instanceof SymbolClassTypeTag) { - symbolNames.add((Tag) d); - } + if (nodeType == TreeNodeType.SYMBOL_CLASS) { + symbolNames.add((Tag) d); } } diff --git a/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java b/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java index 27f65c04d..070024415 100644 --- a/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java +++ b/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java @@ -58,6 +58,7 @@ public enum TreeNodeType { VIDEO_FRAME, SOUND, SOUND_STREAM_BLOCK, + SOUND_STREAM_RANGE, BINARY_DATA, OTHER_TAG, FOLDER, diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange16.png b/src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange16.png new file mode 100644 index 0000000000000000000000000000000000000000..069a92fac25a63ba5536a258effd36d9f110deeb GIT binary patch literal 643 zcmV-}0(||6P)EX>4Tx04R}tkv&MmKpe$iQ>9WW4t5afkfA!+MMXN6Di*;)X)CnqU~=gfG-*gu zTpR`0f`cE6RRgn8K9-iat9zMR_#dwzYxj)CSQZgCf6NwW{H!R`};<-&r z=e$oGW>rZcJ|~_s=z_$LT$f#b<6LoA;F)0~pPeTT6N{BTmiw4h4V8G7II5@`9m;eI1K&NHf-^aGyIRX67z?IhXH`+k_lk`?k ziyi?Z+rY(jPm}k6%N=0sNtX=Ck^D4;av69(qi-q#qqjhC&F!tbkJASrPhBnF00)P_ zWQDTVJ>EUk-`l@uy8ZnCEdFxwdgj8o00006VoOIv07?KZ04@auow5J`010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=?5GOG9qC$E~x+j02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003J_L_t(I%dL`84!|G?LtE~D=lZ#k4MP5P)EX>4Tx04R}tkv&MmKpe$iQ>9WW4t5afkfA!+MMXN6Di*;)X)CnqU~=gfG-*gu zTpR`0f`cE6RRgn8K9-iat9zMR_#dwzYxj)CSQZgCf6NwW{H!R`};<-&r z=e$oGW>rZcJ|~_s=z_$LT$f#b<6LoA;F)0~pPeTT6N{BTmiw4h4V8G7II5@`9m;eI1K&NHf-^aGyIRX67z?IhXH`+k_lk`?k ziyi?Z+rY(jPm}k6%N=0sNtX=Ck^D4;av69(qi-q#qqjhC&F!tbkJASrPhBnF00)P_ zWQDTVJ>EUk-`l@uy8ZnCEdFxwdgj8o00006VoOIv07?KZ04@auow5J`010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=?5GOH#c#gJ_i5*02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{006N`L_t(o!|j(*4ul{KL^};9*!$mg{4(yYh*k#BXcIrw zro1v^BW7>pgS~3|=uU$Gs$xnBeq>+LJe5uSCE4sm#Z2e+GWWr`C3Uh zU%3CAG=oxtdOu)$T(&Yle%8I)DAq@ctJ4jjsR!)!zySapGy!md9XJmmlwb=2Sl+F3 zT-(`y{`Y;pR?>GJgZ2@+2LXT!%z=`&T~9`m|3J!;S^#_=cM6^Wt57jQ83(@D00000 LNkvXXu0mjfi%Kp! literal 0 HcmV?d00001 diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java index 28750e4cb..0a82b3330 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java @@ -384,7 +384,7 @@ public abstract class AbstractTagTree extends JTree { } if (t instanceof SoundStreamFrameRange) { - return TreeNodeType.SOUND_STREAM_BLOCK; + return TreeNodeType.SOUND_STREAM_RANGE; } if (t instanceof SoundStreamBlockTag) { @@ -822,6 +822,9 @@ public abstract class AbstractTagTree extends JTree { if (nodeType == TreeNodeType.SOUND) { ret.add(d); } + if (nodeType == TreeNodeType.SOUND_STREAM_RANGE) { + ret.add(d); + } if (nodeType == TreeNodeType.BINARY_DATA) { ret.add(d); } @@ -831,11 +834,8 @@ public abstract class AbstractTagTree extends JTree { if (nodeType == TreeNodeType.FONT) { ret.add(d); } - - if (nodeType == TreeNodeType.OTHER_TAG) { - if (d instanceof SymbolClassTypeTag) { - ret.add(d); - } + if (nodeType == TreeNodeType.SYMBOL_CLASS) { + ret.add(d); } }