mirror of
https://github.com/samsonjs/media.git
synced 2026-04-01 10:35:48 +00:00
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:
parent
31552b8cdf
commit
e4e6a1caf0
3 changed files with 4 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue