diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/av')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java index 77cf4ff77..89c15b905 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java @@ -93,10 +93,10 @@ interface FFMPEGNatives { COUNT; ///< Number of sample formats. public static SampleFormat valueOf(int i) { - for (SampleFormat fmt : SampleFormat.values()) { - if(fmt.ordinal() == i) { - return fmt; - } + // ordinal = enumValue.ordinal(), reverse: enumValue = EnumClass.values()[ordinal] + final SampleFormat[] all = SampleFormat.values(); + if( 0 <= i && i < all.length ) { + return all[i]; } return null; } @@ -247,10 +247,10 @@ interface FFMPEGNatives { COUNT ///< number of pixel formats in this list ; public static PixelFormat valueOf(int i) { - for (PixelFormat fmt : PixelFormat.values()) { - if(fmt.ordinal() == i) { - return fmt; - } + // ordinal = enumValue.ordinal(), reverse: enumValue = EnumClass.values()[ordinal] + final PixelFormat[] all = PixelFormat.values(); + if( 0 <= i && i < all.length ) { + return all[i]; } return null; } |