Expand dangal workaround to all API levels

It doesn't seem worth keeping the cap, since the device
will presumably stop receiving major version updates at
some point anyway.

Issue: #6899
PiperOrigin-RevId: 291899439
This commit is contained in:
olly 2020-01-28 11:20:11 +00:00 committed by Ian Baker
parent 9161fe2328
commit 331edb4fb2

View file

@ -1601,9 +1601,14 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
}
synchronized (MediaCodecVideoRenderer.class) {
if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) {
if (Util.SDK_INT <= 27 && ("dangal".equals(Util.DEVICE) || "HWEML".equals(Util.DEVICE))) {
// A small number of devices are affected on API level 27:
// https://github.com/google/ExoPlayer/issues/5169.
if ("dangal".equals(Util.DEVICE)) {
// Workaround for MiTV devices:
// https://github.com/google/ExoPlayer/issues/5169,
// https://github.com/google/ExoPlayer/issues/6899.
deviceNeedsSetOutputSurfaceWorkaround = true;
} else if (Util.SDK_INT <= 27 && "HWEML".equals(Util.DEVICE)) {
// Workaround for Huawei P20:
// https://github.com/google/ExoPlayer/issues/4468#issuecomment-459291645.
deviceNeedsSetOutputSurfaceWorkaround = true;
} else if (Util.SDK_INT >= 27) {
// In general, devices running API level 27 or later should be unaffected. Do nothing.