Don't calculate a maximum input size for H.264 on Sony 4k TV.

Issue: #800
This commit is contained in:
Oliver Woodman 2015-10-12 12:24:48 +01:00
parent a764b359e8
commit 952bd4e73c
2 changed files with 11 additions and 0 deletions

View file

@ -560,6 +560,11 @@ public class MediaCodecVideoTrackRenderer extends MediaCodecTrackRenderer {
// Already set. The source of the format may know better, so do nothing.
return;
}
if ("BRAVIA 4K 2015".equals(Util.MODEL)) {
// The Sony BRAVIA 4k TV has input buffers that are too small for the calculated 4k video
// maximum input size, so use the default value.
return;
}
int maxHeight = format.getInteger(android.media.MediaFormat.KEY_HEIGHT);
if (codecIsAdaptive && format.containsKey(android.media.MediaFormat.KEY_MAX_HEIGHT)) {
maxHeight = Math.max(maxHeight, format.getInteger(android.media.MediaFormat.KEY_MAX_HEIGHT));

View file

@ -75,6 +75,12 @@ public final class Util {
*/
public static final String MANUFACTURER = android.os.Build.MANUFACTURER;
/**
* Like {@link android.os.Build#MODEL}, but in a place where it can be conveniently overridden for
* local testing.
*/
public static final String MODEL = android.os.Build.MODEL;
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+))?"