Reduce conditional nesting.

PiperOrigin-RevId: 413682281
This commit is contained in:
hschlueter 2021-12-02 16:14:48 +00:00 committed by Ian Baker
parent fbbedf32f9
commit 14b849aba8

View File

@ -102,22 +102,24 @@ import java.io.IOException;
return false; return false;
} }
if (!frameEditor.hasInputData()) { if (frameEditor.hasInputData()) {
if (!waitingForPopulatedDecoderSurface) { waitingForPopulatedDecoderSurface = false;
if (decoder.getOutputBufferInfo() != null) { frameEditor.processData();
decoder.releaseOutputBuffer(/* render= */ true); return true;
waitingForPopulatedDecoderSurface = true; }
}
if (decoder.isEnded()) { if (waitingForPopulatedDecoderSurface) {
encoder.signalEndOfInputStream();
}
}
return false; return false;
} }
waitingForPopulatedDecoderSurface = false; if (decoder.getOutputBufferInfo() != null) {
frameEditor.processData(); decoder.releaseOutputBuffer(/* render= */ true);
return true; waitingForPopulatedDecoderSurface = true;
}
if (decoder.isEnded()) {
encoder.signalEndOfInputStream();
}
return false;
} }
@Override @Override