From 3e2656e6fd58c52ee0aed272c8b3f7993437a60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 9 Nov 2025 18:53:07 +0100 Subject: [PATCH] Fixed: #2550 FLV video import - incorrect frame position caused by wrong FLV tag sort --- CHANGELOG.md | 2 ++ .../com/jpexs/decompiler/flash/importers/MovieImporter.java | 6 +++--- src/com/jpexs/decompiler/flash/gui/MainPanel.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1b46a1d..f8c600090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file. - [#2552] Open with FFDec explorer menu shrinking sidebar - [#2551] Showing too wide video tags in Flash player producing ValueTooLarge exception. Also truncated video length. +- [#2550] FLV video import - incorrect frame position caused by wrong FLV tag sort ## [24.1.0] - 2025-09-28 ### Added @@ -4038,6 +4039,7 @@ Major version of SWF to XML export changed to 2. [#2545]: https://www.free-decompiler.com/flash/issues/2545 [#2552]: https://www.free-decompiler.com/flash/issues/2552 [#2551]: https://www.free-decompiler.com/flash/issues/2551 +[#2550]: https://www.free-decompiler.com/flash/issues/2550 [#2477]: https://www.free-decompiler.com/flash/issues/2477 [#2478]: https://www.free-decompiler.com/flash/issues/2478 [#2485]: https://www.free-decompiler.com/flash/issues/2485 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/MovieImporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/MovieImporter.java index 774558a1e..82a1b9034 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/MovieImporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/MovieImporter.java @@ -264,17 +264,17 @@ public class MovieImporter { if (newWidth <= 0 || newHeight <= 0) { throw new IOException("Invalid dimension"); } + movie.setPauseRendering(true); movie.codecID = videoData.codecId; movie.width = newWidth; movie.height = newHeight; movie.videoFlagsDeblocking = DefineVideoStreamTag.DEBLOCKING_OFF; movie.videoFlagsSmoothing = true; - movie.setPauseRendering(true); - + videoTags.sort(new Comparator() { @Override public int compare(FLVTAG o1, FLVTAG o2) { - return Long.compare(o1.timeStamp, o2.tagType); + return Long.compare(o1.timeStamp, o2.timeStamp); } }); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 25fc15aa6..1cfa3b6ce 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -5446,7 +5446,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se File selfile = Helper.fixDialogFile(selectedFile); try { new MovieImporter().importMovie(movie, Helper.readFile(selfile.getAbsolutePath())); - refreshTree(); + refreshTree(movie.getSwf()); } catch (IOException ex) { logger.log(Level.SEVERE, "Invalid movie", ex); ViewMessages.showMessageDialog(MainPanel.this, translate("error.movie.invalid") + ": " + ex.getMessage(), translate("error"), JOptionPane.ERROR_MESSAGE);