| Index: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
|
| diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
|
| index 0c012de85d6262bebf419bea6da5cb0539ca488f..660c37f15c7b1809c2e0438b521e5960f2842f49 100644
|
| --- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
|
| +++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
|
| @@ -489,6 +489,7 @@ class MediaCodecBridge {
|
| MediaFormat.KEY_MAX_HEIGHT, format.getInteger(MediaFormat.KEY_HEIGHT));
|
| }
|
| maybeSetMaxInputSize(format);
|
| + disableAutomaticFrameRateConversion(format);
|
| mMediaCodec.configure(format, surface, crypto, flags);
|
| return true;
|
| } catch (IllegalArgumentException e) {
|
| @@ -561,6 +562,19 @@ class MediaCodecBridge {
|
| format.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, maxInputSize);
|
| }
|
|
|
| + /** Disables automatic frame rate conversion logic if the device uses it. */
|
| + private void disableAutomaticFrameRateConversion(MediaFormat format) {
|
| + // MediaCodec on nVidia Shield tablets changes frame timestamps to adjust the playback rate
|
| + // to better map the frame rate of the content to the refresh rate of the display. For
|
| + // example playback of 23.976fps content is adjusted to play at 1.001x speed when the output
|
| + // display is 60Hz. We have to disable it because we rely on the timestamps passing through
|
| + // MediaCodec unaltered. For more details see b/26453592 and the ExoPlayer code:
|
| + // https://github.com/google/ExoPlayer/blob/706c6908ec57005044f4b4a9f5b80266cad9eda3/library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java#L1169
|
| + if ("foster".equals(Build.MODEL) && "NVIDIA".equals(Build.MANUFACTURER)) {
|
| + format.setInteger("auto-frc", 0);
|
| + }
|
| + }
|
| +
|
| @CalledByNative
|
| private static MediaFormat createVideoEncoderFormat(String mime, int width, int height,
|
| int bitRate, int frameRate, int iFrameInterval, int colorFormat) {
|
|
|