Index: media/base/android/java/src/org/chromium/media/MediaCodecUtil.java |
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java |
index 5599b459c7e2f74e53bbfd331d02bf36928487be..e392c6ebdaea331b9a59c1e89157ac1229a2890b 100644 |
--- a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java |
+++ b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java |
@@ -234,6 +234,29 @@ class MediaCodecUtil { |
} |
/** |
+ * Returns true if and only enabling adaptive playback is unsafe. On some |
+ * device / os combinations, enabling it causes decoded frames to be |
+ * unusable. For example, the S3 on 4.4.2 returns black and white, tiled |
+ * frames when this is enabled. |
+ */ |
+ private static boolean isAdaptivePlaybackBlacklisted(String mime) { |
+ if (!mime.equals("video/avc") && !mime.equals("video/avc1")) { |
+ return false; |
+ } |
+ |
+ if (!Build.VERSION.RELEASE.equals("4.4.2")) { |
+ return false; |
+ } |
+ |
+ if (!Build.MANUFACTURER.toLowerCase(Locale.getDefault()).equals("samsung")) { |
+ return false; |
+ } |
+ |
+ return Build.MODEL.startsWith("GT-I9300") || // S3 (I9300 / I9300I) |
+ Build.MODEL.startsWith("SCH-I535"); // S3 |
+ } |
+ |
+ /** |
* Returns true if the given codec supports adaptive playback (dynamic resolution change). |
* @param mediaCodec the codec. |
* @param mime MIME type that corresponds to the codec creation. |
@@ -249,6 +272,11 @@ class MediaCodecUtil { |
if (info.isEncoder()) { |
return false; |
} |
+ |
+ if (isAdaptivePlaybackBlacklisted(mime)) { |
+ return false; |
+ } |
+ |
MediaCodecInfo.CodecCapabilities capabilities = info.getCapabilitiesForType(mime); |
return (capabilities != null) |
&& capabilities.isFeatureSupported( |