From 78b635726a9855e532c495a38926e00e3374510b Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sun, 10 Apr 2016 17:58:36 -0400 Subject: [PATCH] AL: fix crash when device is disconnected --- .../main/java/com/jme3/audio/openal/ALAudioRenderer.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java b/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java index 0878e23fa..82c588d4d 100644 --- a/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java +++ b/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java @@ -904,11 +904,12 @@ public class ALAudioRenderer implements AudioRenderer, Runnable { } else { // Buffer finished playing. if (src.isLooping()) { - throw new AssertionError("Unexpected state: " + - "A looping sound has stopped playing"); - } else { - reclaimChannel = true; + // When a device is disconnected, all sources + // will enter the "stopped" state. + logger.warning("A looping sound has stopped playing"); } + + reclaimChannel = true; } if (reclaimChannel) {