aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-28 09:08:28 +0100
committerSven Göthel <[email protected]>2024-01-28 09:08:28 +0100
commit28e5b66e6e201259c6ad240552045314d2072595 (patch)
tree47a4aacbd73cb64a62713132c1158813ee74501d /src/graphui/classes/com/jogamp
parent9aeff8cb3113729adcb5910061015a88ac827002 (diff)
GraphUI MediaButton: Clear cached subtitle data on uninit and init from GLMediaPlayer
Diffstat (limited to 'src/graphui/classes/com/jogamp')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java
index 931f12341..ff3747bdf 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java
@@ -169,8 +169,12 @@ public class MediaButton extends TexSeqButton {
System.err.println("MediaButton AttributesChanges: "+eventMask+", when "+when);
System.err.println("MediaButton State: "+mp);
}
+ if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Uninit) ) {
+ clearSubtitleCache();
+ }
if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Init) ) {
resetGL = true;
+ clearSubtitleCache();
}
if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Size) ) {
// FIXME: mPlayer.resetGLState();
@@ -229,7 +233,13 @@ public class MediaButton extends TexSeqButton {
}
markStateDirty(); // keep on going
};
- protected final void drawSubtitle(final GL2ES2 gl, final RegionRenderer renderer) {
+ private final void clearSubtitleCache() {
+ draw_lastASS = null;
+ synchronized( assEventLock ) {
+ assEventQueue.clear();
+ }
+ }
+ private final void drawSubtitle(final GL2ES2 gl, final RegionRenderer renderer) {
// dequeue and earmark new subtitle
final ASSEventLine ass;
final boolean newASS;
@@ -300,6 +310,6 @@ public class MediaButton extends TexSeqButton {
}
}
- private ASSEventLine draw_lastASS;
+ private volatile ASSEventLine draw_lastASS;
}