From 5bacb8e6887b55ab2053dc5ed76bebcc0743a45e Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Wed, 7 Feb 2024 02:26:59 +0100 Subject: GLMediaPlayerImpl: Adjust aid/sid to AUTO if alang/slang is given --- src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index ff683281c..089f91544 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -751,15 +751,17 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } + final int aid2 = alang != null && alang.length() > 0 ? STREAM_ID_AUTO : aid; + final int sid2 = slang != null && slang.length() > 0 ? STREAM_ID_AUTO : sid; this.vid = vid; - this.aid = aid; - this.sid = sid; + this.aid = aid2; + this.sid = sid2; new InterruptSource.Thread() { @Override public void run() { try { // StreamWorker may be used, see API-doc of StreamWorker - initStreamImpl(vid, alang, aid, slang, sid); + initStreamImpl(vid, alang, aid2, slang, sid2); } catch (final Throwable t) { streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t); changeState(new GLMediaPlayer.EventMask(GLMediaPlayer.EventMask.Bit.Error), GLMediaPlayer.State.Uninitialized); -- cgit v1.2.3