Skip to content

Commit 8895dc1

Browse files
committed
fix可能出现的丢帧问题
1 parent f4cb46e commit 8895dc1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app/src/main/java/com/demo/mediacodec/transcode/TranscodeRunner.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ public void onOutputFormatChanged(@NonNull MediaCodec codec,
470470
}
471471
}, mDecodeCodecHandler);
472472
mDecoderOutputSurface = new OutputSurface();
473+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
474+
mOriVideoFormat.setInteger("allow-frame-drop", 0);
475+
}
473476
mDecoder.configure(mOriVideoFormat, mDecoderOutputSurface.getSurface(), null, 0);
474477
}
475478

0 commit comments

Comments
 (0)