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 000000000..069a92fac Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange32.png b/src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange32.png new file mode 100644 index 000000000..afa1c9ee3 Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/soundstreamrange32.png differ 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); } }