From 30b0ec4e2602a9e1d8a4ccf202bf9d243cd8f608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 6 Apr 2026 17:46:44 +0200 Subject: [PATCH] fix: correctly flush sound data to avoid weird sound noises (#2689) Fixes #2689 --- src/com/jpexs/decompiler/flash/gui/SoundTagPlayer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/SoundTagPlayer.java b/src/com/jpexs/decompiler/flash/gui/SoundTagPlayer.java index 2c4f937b2..be23cc845 100644 --- a/src/com/jpexs/decompiler/flash/gui/SoundTagPlayer.java +++ b/src/com/jpexs/decompiler/flash/gui/SoundTagPlayer.java @@ -339,6 +339,7 @@ public class SoundTagPlayer implements MediaDisplay { } if (getPausedFlag()) { + sourceLine.flush(); synchronized (thread) { try { thread.wait(1000); @@ -350,8 +351,8 @@ public class SoundTagPlayer implements MediaDisplay { } if (getClosedFlag()) { - sourceLine.drain(); sourceLine.stop(); + sourceLine.flush(); sourceLine.close(); } audioStream.close(); @@ -362,6 +363,7 @@ public class SoundTagPlayer implements MediaDisplay { } if (!getClosedFlag()) { + sourceLine.drain(); decreaseLoopCount(); int currentLoopCount; @@ -383,7 +385,6 @@ public class SoundTagPlayer implements MediaDisplay { firePlayingFinished(); if (getClosedFlag()) { - sourceLine.drain(); sourceLine.stop(); sourceLine.close(); return;