mirror of
https://github.com/samsonjs/media.git
synced 2026-03-31 10:25:48 +00:00
Add device-specific workarounds for VP8 and MP3.
Avoid using the VP8 decoder on Samsung Galaxy S4 Mini. Issue: #548 Avoid using the MP3 decoder on Sony Xperia Z/API level 16. Issue: #377
This commit is contained in:
parent
c47c6816e4
commit
2358004951
2 changed files with 16 additions and 3 deletions
|
|
@ -175,15 +175,22 @@ public class MediaCodecUtil {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Workaround an issue where creating a particular MP3 decoder on some HTC devices on platform
|
||||
// API version 16 crashes mediaserver.
|
||||
// Work around an issue where creating a particular MP3 decoder on some devices on platform API
|
||||
// version 16 crashes mediaserver.
|
||||
if (Util.SDK_INT == 16
|
||||
&& ("dlxu".equals(Util.DEVICE) // HTC Butterfly
|
||||
|| "protou".equals(Util.DEVICE)) // HTC Desire X
|
||||
|| "protou".equals(Util.DEVICE) // HTC Desire X
|
||||
|| "C6602".equals(Util.DEVICE) || "C6603".equals(Util.DEVICE)) // Sony Xperia Z
|
||||
&& name.equals("OMX.qcom.audio.decoder.mp3")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Work around an issue where the VP8 decoder on Samsung Galaxy S4 Mini does not render video.
|
||||
if (Util.SDK_INT <= 19 && Util.DEVICE != null && Util.DEVICE.startsWith("serrano")
|
||||
&& "samsung".equals(Util.MANUFACTURER) && name.equals("OMX.SEC.vp8.dec")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,12 @@ public final class Util {
|
|||
*/
|
||||
public static final String DEVICE = android.os.Build.DEVICE;
|
||||
|
||||
/**
|
||||
* Like {@link android.os.Build#MANUFACTURER}, but in a place where it can be conveniently
|
||||
* overridden for local testing.
|
||||
*/
|
||||
public static final String MANUFACTURER = android.os.Build.MANUFACTURER;
|
||||
|
||||
private static final Pattern XS_DATE_TIME_PATTERN = Pattern.compile(
|
||||
"(\\d\\d\\d\\d)\\-(\\d\\d)\\-(\\d\\d)[Tt]"
|
||||
+ "(\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d+))?"
|
||||
|
|
|
|||
Loading…
Reference in a new issue