From bc033211df02addda7531f2eab5a467f806d5a95 Mon Sep 17 00:00:00 2001 From: ibaker Date: Wed, 24 Mar 2021 16:30:48 +0000 Subject: [PATCH] Treat Dolby Vision as H264 in MCVR#getCodecMaxInputSize() Issue: #8705 PiperOrigin-RevId: 364821429 --- RELEASENOTES.md | 3 +++ .../android/exoplayer2/video/MediaCodecVideoRenderer.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8b477adcecf..cd84424076d 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -32,6 +32,9 @@ * Fix playback position issue when re-preparing playback after a BehindLiveWindowException ([#8675](https://github.com/google/ExoPlayer/issues/8675)). + * Assume Dolby Vision content is encoded as H264 when calculating maximum + codec input size + ([#8705](https://github.com/google/ExoPlayer/issues/8705)). * HLS: * Fix issue that could cause playback to become stuck if corresponding `EXT-X-DISCONTINUITY` tags in different media playlists occur at diff --git a/library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java b/library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java index 57cf1a1fb2e..175f72fee3d 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java @@ -1488,6 +1488,9 @@ private static int getCodecMaxInputSize( maxPixels = width * height; minCompressionRatio = 2; break; + case MimeTypes.VIDEO_DOLBY_VISION: + // Dolby vision can be a wrapper around H264 or H265. We assume H264 here because the + // minimum compression ratio is lower, meaning we overestimate the maximum input size. case MimeTypes.VIDEO_H264: if ("BRAVIA 4K 2015".equals(Util.MODEL) // Sony Bravia 4K || ("Amazon".equals(Util.MANUFACTURER)