diff --git a/app/src/main/java/com/facebook/encapp/SurfaceEncoder.java b/app/src/main/java/com/facebook/encapp/SurfaceEncoder.java index d4992dc..de8fe97 100644 --- a/app/src/main/java/com/facebook/encapp/SurfaceEncoder.java +++ b/app/src/main/java/com/facebook/encapp/SurfaceEncoder.java @@ -436,9 +436,12 @@ protected void checkRealtime() { // Without it the extractor will read as fast a possible // until no buffers are available. mRealtime = true; - } else { - if (mOutputMult != null) - mOutputMult.setRealtime(false); + } + } + if (!mRealtime) { + if (mOutputMult != null) { + Log.d(TAG, "Outputmultiplier will work in non realtime mode"); + mOutputMult.setRealtime(false); } } } @@ -447,6 +450,14 @@ private void setupOutputMult(int width, int height) { if (mOutputMult != null) { mOutputMult.setName("SE_" + mTest.getInput().getFilepath() + "_enc-" + mTest.getConfigure().getCodec()); mOutputMult.confirmSize(width, height); + + // Need to update outputmulti and configure working mode. + if (!mRealtime) { + if (mOutputMult != null) { + Log.d(TAG, "Outputmultiplier will work in non realtime mode"); + mOutputMult.setRealtime(false); + } + } } } diff --git a/app/src/main/java/com/facebook/encapp/SurfaceTranscoder.java b/app/src/main/java/com/facebook/encapp/SurfaceTranscoder.java index 15a8b53..5efd148 100644 --- a/app/src/main/java/com/facebook/encapp/SurfaceTranscoder.java +++ b/app/src/main/java/com/facebook/encapp/SurfaceTranscoder.java @@ -42,7 +42,6 @@ public class SurfaceTranscoder extends SurfaceEncoder implements VsyncListener { MediaExtractor mExtractor; MediaCodec mDecoder; DecoderRuntime mDecoderRuntimeParams; - OutputMultiplier mOutputMult = null; double mLoopTime = 0; int mCurrentLoop = 1; long mPtsOffset = 0;