mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-24 20:44:33 +00:00
fix: correctly flush sound data to avoid weird sound noises (#2689)
Fixes #2689
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user