Switch from AudioFormat.ENCODING_DEFAULT to .ENCODING_PCM_16BIT.

AudioTrack.getMinBufferSize does not handle ENCODING_DEFAULT so
switch back to ENCODING_PCM_16BIT.
This commit is contained in:
Oliver Woodman 2015-04-17 19:59:03 +01:00
parent 31552b8cdf
commit e4e6a1caf0
3 changed files with 4 additions and 4 deletions

View file

@ -299,7 +299,7 @@ public class DashRendererBuilder implements RendererBuilder,
boolean useAc3Passthrough = haveAc3Tracks && audioCapabilities != null
&& (audioCapabilities.supportsAc3() || audioCapabilities.supportsEAc3());
audioRenderer = new MediaCodecAudioTrackRenderer(audioSampleSource, drmSessionManager, true,
mainHandler, player, useAc3Passthrough ? C.ENCODING_AC3 : AudioFormat.ENCODING_DEFAULT);
mainHandler, player, useAc3Passthrough ? C.ENCODING_AC3 : AudioFormat.ENCODING_PCM_16BIT);
}
// Build the text chunk sources.

View file

@ -125,7 +125,7 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer {
public MediaCodecAudioTrackRenderer(SampleSource source, DrmSessionManager drmSessionManager,
boolean playClearSamplesWithoutKeys, Handler eventHandler, EventListener eventListener) {
this(source, drmSessionManager, playClearSamplesWithoutKeys, eventHandler, eventListener,
AudioFormat.ENCODING_DEFAULT);
AudioFormat.ENCODING_PCM_16BIT);
}
/**

View file

@ -313,10 +313,10 @@ public final class AudioTrack {
/**
* Reconfigures the audio track to play back media in {@code format}. The encoding is assumed to
* be {@link AudioFormat#ENCODING_DEFAULT}.
* be {@link AudioFormat#ENCODING_PCM_16BIT}.
*/
public void reconfigure(MediaFormat format) {
reconfigure(format, AudioFormat.ENCODING_DEFAULT, 0);
reconfigure(format, AudioFormat.ENCODING_PCM_16BIT, 0);
}
/**