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