Don't constrain audio for playout in Transformer

Transformer's input shouldn't be constrained to the number of playable audio channels on the current device because the media may be edited (to mix channels for example) or encoded for playback on another device (a server for example).

PiperOrigin-RevId: 625604243
This commit is contained in:
andrewlewis 2024-04-17 01:53:53 -07:00 committed by Copybara-Service
parent 83d1600c7e
commit a58a99e84d
2 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,8 @@
* Transformer:
* Work around a decoder bug where the number of audio channels was capped
at stereo when handling PCM input.
* When selecting tracks in `ExoPlayerAssetLoader`, ignore audio channel
count constraints as they only apply for playback.
* Track Selection:
* Extractors:
* Audio:

View File

@ -160,6 +160,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
trackSelector.setParameters(
new DefaultTrackSelector.Parameters.Builder(context)
.setForceHighestSupportedBitrate(true)
.setConstrainAudioChannelCountToDeviceCapabilities(false)
.build());
// Arbitrarily decrease buffers for playback so that samples start being sent earlier to the
// exporters (rebuffers are less problematic for the export use case).