Transformer: Simplify EncoderWrapper rotationDegrees logic.

Small refactoring change to simplify the logic a tiny bit by removing one
unnecessary variable. No functional change intended.

PiperOrigin-RevId: 501566533
This commit is contained in:
huangdarwin 2023-01-12 16:01:29 +00:00 committed by Rohit Singh
parent d2c5a1bfb9
commit e47307d95f

View File

@ -425,8 +425,7 @@ import org.checkerframework.dataflow.qual.Pure;
// frame before encoding, so the encoded frame's width >= height, and sets
// rotationDegrees in the output Format to ensure the frame is displayed in the correct
// orientation.
boolean flipOrientation = requestedWidth < requestedHeight;
if (flipOrientation) {
if (requestedWidth < requestedHeight) {
int temp = requestedWidth;
requestedWidth = requestedHeight;
requestedHeight = temp;
@ -477,7 +476,7 @@ import org.checkerframework.dataflow.qual.Pure;
fallbackListener.onTransformationRequestFinalized(
createSupportedTransformationRequest(
transformationRequest,
/* hasOutputFormatRotation= */ flipOrientation,
/* hasOutputFormatRotation= */ outputRotationDegrees != 0,
requestedEncoderFormat,
encoderSupportedFormat,
supportedFallbackHdrMode));