aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-08-28 02:45:27 +0200
committerSven Gothel <[email protected]>2013-08-28 02:45:27 +0200
commitb99511d438a6c621a5afc582168cca69bd2eb9da (patch)
treead73570908b4d411617d786a8f739d7ad1f40f67 /src/jogl/classes/jogamp/opengl
parent15ec34db947f89b1d20043b729a09413a425de5d (diff)
FFMPEGMediaPlayer: Fix av-audio-fmt -> AudioFormat parsing (fixedP was wrong for float values)
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java15
1 files changed, 7 insertions, 8 deletions
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 f46c5900c..952587ed9 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -365,10 +365,11 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param audioChannels number of channels
*/
final boolean isAudioFormatSupported(int audioSampleFmt, int audioSampleRate, int audioChannels) {
- final AudioFormat audioFormat = avAudioFormat2Local(SampleFormat.valueOf(audioSampleFmt), audioSampleRate, audioChannels);
+ final SampleFormat avFmt = SampleFormat.valueOf(audioSampleFmt);
+ final AudioFormat audioFormat = avAudioFormat2Local(avFmt, audioSampleRate, audioChannels);
final boolean res = audioSink.isSupported(audioFormat);
if( DEBUG ) {
- System.err.println("AudioSink.isSupported: "+res+": "+audioFormat);
+ System.err.println("AudioSink.isSupported: "+res+": av[fmt "+avFmt+", rate "+audioSampleRate+", chan "+audioChannels+"] -> "+audioFormat);
}
return res;
}
@@ -382,42 +383,40 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
private final AudioFormat avAudioFormat2Local(SampleFormat audioSampleFmt, int audioSampleRate, int audioChannels) {
final int sampleSize;
boolean planar = true;
- final boolean signed, fixedP;
+ boolean fixedP = true;
+ final boolean signed;
switch( audioSampleFmt ) {
case S32:
planar = false;
case S32P:
sampleSize = 32;
signed = true;
- fixedP = true;
break;
case S16:
planar = false;
case S16P:
sampleSize = 16;
signed = true;
- fixedP = true;
break;
case U8:
planar = false;
case U8P:
sampleSize = 8;
signed = false;
- fixedP = true;
break;
case DBL:
planar = false;
case DBLP:
sampleSize = 64;
signed = true;
- fixedP = true;
+ fixedP = false;
break;
case FLT:
planar = false;
case FLTP:
sampleSize = 32;
signed = true;
- fixedP = true;
+ fixedP = false;
break;
default: // FIXME: Add more formats !
throw new IllegalArgumentException("Unsupported sampleformat: "+audioSampleFmt);