From 3e8894de1b26caf93e7d7b395aff332a3c522d65 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 21 May 2023 16:51:52 +0200 Subject: *MediaPlayer: Adop to JOAL 39a32fd56de313c31bd197ee6022288e97f9729a --- src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 6 +++++- src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl') diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index e9a154bbb..9e390319a 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -1698,7 +1698,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { final String audioSinkInfo; final AudioSink audioSink = getAudioSink(); if( null != audioSink ) { - audioSinkInfo = "AudioSink[frames [p "+audioSink.getEnqueuedFrameCount()+", q "+audioSink.getQueuedFrameCount()+", f "+audioSink.getFreeFrameCount()+", c "+audioSink.getFrameCount()+"], time "+audioSink.getQueuedTime()+", bytes "+audioSink.getQueuedByteCount()+"]"; + audioSinkInfo = String.format("AudioSink[frames [p %d, q %d, f %d, c %d], dur %.1f ms, bytes %d]", + audioSink.getEnqueuedFrameCount(), audioSink.getQueuedFrameCount(), + audioSink.getFreeFrameCount(), audioSink.getFrameCount(), 1000f*audioSink.getQueuedTime(), + audioSink.getQueuedByteCount() + ); } else { audioSinkInfo = ""; } diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java index 25ef6fd8a..d6bbbdc5d 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java @@ -432,7 +432,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { } else { final int frameDuration; if( audioSamplesPerFrameAndChannel > 0 ) { - frameDuration = avChosenAudioFormat.getSamplesDuration(audioSamplesPerFrameAndChannel); + frameDuration = Math.round( 1000f * avChosenAudioFormat.getSamplesDuration(audioSamplesPerFrameAndChannel) ); } else { frameDuration = AudioSink.DefaultFrameDuration; } -- cgit v1.2.3