From c4368e89c0fc3ee4de659cd760bc812092bba054 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 22 Feb 2014 08:04:45 +0100 Subject: ALAudioSink: Add thread-name to exceptions; stopImpl shall not throw an exception at destroy --- .../jogamp/opengl/openal/av/ALAudioSink.java | 60 ++++++++++++++-------- 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'src/jogl/classes') diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java index 3caf340b9..eeaaa5872 100644 --- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java @@ -227,7 +227,7 @@ public class ALAudioSink implements AudioSink { } final int alcErr = alc.alcGetError(null); if( ALC.ALC_NO_ERROR != alcErr ) { - final String err = "ALCError "+toHexString(alcErr)+" while makeCurrent. "+this; + final String err = getThreadName()+": ALCError "+toHexString(alcErr)+" while makeCurrent. "+this; System.err.println(err); Thread.dumpStack(); lock.unlock(); @@ -235,8 +235,10 @@ public class ALAudioSink implements AudioSink { } final int alErr = al.alGetError(); if( ALC.ALC_NO_ERROR != alErr ) { - System.err.println("Prev - ALError "+toHexString(alErr)+" @ makeCurrent. "+this); - Thread.dumpStack(); + if( DEBUG ) { + System.err.println(getThreadName()+": Prev - ALError "+toHexString(alErr)+" @ makeCurrent. "+this); + Thread.dumpStack(); + } } } private final void unlockContext() { @@ -368,7 +370,7 @@ public class ALAudioSink implements AudioSink { final int err = al.alGetError(); if( AL.AL_NO_ERROR != err ) { alBufferNames = null; - throw new RuntimeException("ALAudioSink: Error generating Buffers: 0x"+Integer.toHexString(err)); + throw new RuntimeException(getThreadName()+": ALAudioSink: Error generating Buffers: 0x"+Integer.toHexString(err)); } final ALAudioFrame[] alFrames = new ALAudioFrame[initialFrameCount]; for(int i=0; i