diff options
author | Sven Gothel <[email protected]> | 2014-02-22 07:48:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-02-22 07:48:03 +0100 |
commit | b9e89c35dac3c19e026d2a0161649a065b3dceee (patch) | |
tree | 44ef0a989551124fd6bb0dad3b35f2b0542538ed /src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java | |
parent | d553668d3c5a687ef626501f4ed5963f16c6dba3 (diff) |
Bug 927 - Multithreading (MT) issues libav/ffmpeg
FFMPEG Natives:
- Move 'mutex_avcodec_openclose' to local static and initialize at initSymbols0
- setStream0:
- Add another locked mutex block around:
- [ sp_avformat_open_input .. sp_avformat_find_stream_info ]
This solves the issue of:
[NULL @ 0x89d20c60] insufficient thread locking around avcodec_open/close()
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java | 13 |
1 files changed, 6 insertions, 7 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 c3fc2898f..b4b887bc9 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java @@ -31,20 +31,19 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame; /* pp */ abstract class FFMPEGNatives { - private static final Object mutex_avcodec_openclose = new Object(); + private static final Object mutex_avcodec_openclose_jni = new Object(); - abstract boolean initSymbols0(long[] symbols, int count); + final boolean initSymbols0(long[] symbols, int count) { + return initSymbols0(mutex_avcodec_openclose_jni, symbols, count); + } + abstract boolean initSymbols0(Object mutex_avcodec_openclose, long[] symbols, int count); abstract int getAvUtilMajorVersionCC0(); abstract int getAvFormatMajorVersionCC0(); abstract int getAvCodecMajorVersionCC0(); abstract int getAvResampleMajorVersionCC0(); abstract int getSwResampleMajorVersionCC0(); - final long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose) { - return createInstance0(mutex_avcodec_openclose, upstream, verbose); - } - abstract long createInstance0(Object mutex_avcodec_openclose, FFMPEGMediaPlayer upstream, boolean verbose); - + abstract long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose); abstract void destroyInstance0(long moviePtr); /** |