Commit 679fa8de by Oliver Woodman

Only use passthrough for passthrough MIME types.

parent e770e5c2
...@@ -160,8 +160,8 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer implem ...@@ -160,8 +160,8 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer implem
} }
/** /**
* Returns whether encoded audio passthrough may be used for playing back the input format. This * Returns whether encoded audio passthrough should be used for playing back the input format.
* implementation returns true if the {@link AudioTrack}'s audio capabilities indicate that * This implementation returns true if the {@link AudioTrack}'s audio capabilities indicate that
* passthrough is supported. * passthrough is supported.
* *
* @param mimeType The type of input media. * @param mimeType The type of input media.
...@@ -174,9 +174,9 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer implem ...@@ -174,9 +174,9 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer implem
@Override @Override
protected void configureCodec(MediaCodec codec, String codecName, protected void configureCodec(MediaCodec codec, String codecName,
android.media.MediaFormat format, android.media.MediaCrypto crypto) { android.media.MediaFormat format, android.media.MediaCrypto crypto) {
if (RAW_DECODER_NAME.equals(codecName)) { String mimeType = format.getString(android.media.MediaFormat.KEY_MIME);
if (RAW_DECODER_NAME.equals(codecName) && !MimeTypes.AUDIO_RAW.equals(mimeType)) {
// Override the MIME type used to configure the codec if we are using a passthrough decoder. // Override the MIME type used to configure the codec if we are using a passthrough decoder.
String mimeType = format.getString(android.media.MediaFormat.KEY_MIME);
format.setString(android.media.MediaFormat.KEY_MIME, MimeTypes.AUDIO_RAW); format.setString(android.media.MediaFormat.KEY_MIME, MimeTypes.AUDIO_RAW);
codec.configure(format, null, crypto, 0); codec.configure(format, null, crypto, 0);
format.setString(android.media.MediaFormat.KEY_MIME, mimeType); format.setString(android.media.MediaFormat.KEY_MIME, mimeType);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment