mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix pre-L codec buffer initialization
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=203341457
This commit is contained in:
parent
acbe52d0d7
commit
5047a5a4da
1 changed files with 2 additions and 2 deletions
|
|
@ -729,7 +729,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
||||||
codec.start();
|
codec.start();
|
||||||
TraceUtil.endSection();
|
TraceUtil.endSection();
|
||||||
codecInitializedTimestamp = SystemClock.elapsedRealtime();
|
codecInitializedTimestamp = SystemClock.elapsedRealtime();
|
||||||
getCodecBuffers();
|
getCodecBuffers(codec);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (codec != null) {
|
if (codec != null) {
|
||||||
resetCodecBuffers();
|
resetCodecBuffers();
|
||||||
|
|
@ -743,7 +743,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
||||||
onCodecInitialized(name, codecInitializedTimestamp, elapsed);
|
onCodecInitialized(name, codecInitializedTimestamp, elapsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getCodecBuffers() {
|
private void getCodecBuffers(MediaCodec codec) {
|
||||||
if (Util.SDK_INT < 21) {
|
if (Util.SDK_INT < 21) {
|
||||||
inputBuffers = codec.getInputBuffers();
|
inputBuffers = codec.getInputBuffers();
|
||||||
outputBuffers = codec.getOutputBuffers();
|
outputBuffers = codec.getOutputBuffers();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue