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,8 +102,16 @@ import java.io.IOException;
return false; return false;
} }
if (!frameEditor.hasInputData()) { if (frameEditor.hasInputData()) {
if (!waitingForPopulatedDecoderSurface) { waitingForPopulatedDecoderSurface = false;
frameEditor.processData();
return true;
}
if (waitingForPopulatedDecoderSurface) {
return false;
}
if (decoder.getOutputBufferInfo() != null) { if (decoder.getOutputBufferInfo() != null) {
decoder.releaseOutputBuffer(/* render= */ true); decoder.releaseOutputBuffer(/* render= */ true);
waitingForPopulatedDecoderSurface = true; waitingForPopulatedDecoderSurface = true;
@ -111,15 +119,9 @@ import java.io.IOException;
if (decoder.isEnded()) { if (decoder.isEnded()) {
encoder.signalEndOfInputStream(); encoder.signalEndOfInputStream();
} }
}
return false; return false;
} }
waitingForPopulatedDecoderSurface = false;
frameEditor.processData();
return true;
}
@Override @Override
@Nullable @Nullable
public DecoderInputBuffer dequeueInputBuffer() { public DecoderInputBuffer dequeueInputBuffer() {