Skip to content

Commit

Permalink
Fix image up-side-down in when playing a Composition
Browse files Browse the repository at this point in the history
When playing a Composition, the color transfer of an image is incorrectly
passed down to be SMPTE170M, but it should be SRGB.

PiperOrigin-RevId: 626425396
  • Loading branch information
claincly authored and copybara-github committed Apr 19, 2024
1 parent fb037b9 commit 716aedd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,11 @@ private void onStreamOffsetChange(long bufferPresentationTimeUs, long streamOffs
}

private static ColorInfo getAdjustedInputColorInfo(@Nullable ColorInfo inputColorInfo) {
return inputColorInfo != null && ColorInfo.isTransferHdr(inputColorInfo)
? inputColorInfo
: ColorInfo.SDR_BT709_LIMITED;
if (inputColorInfo == null || !inputColorInfo.isDataSpaceValid()) {
return ColorInfo.SDR_BT709_LIMITED;
}

return inputColorInfo;
}

/** Receives input from an ExoPlayer renderer and forwards it to the video graph. */
Expand Down

0 comments on commit 716aedd

Please sign in to comment.