mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Merge pull request #728 from lawadr:audio-capabilities-fix
PiperOrigin-RevId: 574829263
This commit is contained in:
commit
5f80a47081
2 changed files with 8 additions and 1 deletions
|
|
@ -22,6 +22,9 @@
|
||||||
* Audio:
|
* Audio:
|
||||||
* Fix DTS Express audio buffer underflow issue
|
* Fix DTS Express audio buffer underflow issue
|
||||||
([#650](https://github.com/androidx/media/pull/650)).
|
([#650](https://github.com/androidx/media/pull/650)).
|
||||||
|
* Fix bug where the capabilities check for E-AC3-JOC throws an
|
||||||
|
`IllegalArgumentException`
|
||||||
|
([#677](https://github.com/androidx/media/issues/677)).
|
||||||
* Video:
|
* Video:
|
||||||
* Text:
|
* Text:
|
||||||
* Remove `ExoplayerCuesDecoder`. Text tracks with `sampleMimeType =
|
* Remove `ExoplayerCuesDecoder`. Text tracks with `sampleMimeType =
|
||||||
|
|
|
||||||
|
|
@ -406,11 +406,15 @@ public final class AudioCapabilities {
|
||||||
// TODO(internal b/234351617): Query supported channel masks directly once it's supported,
|
// TODO(internal b/234351617): Query supported channel masks directly once it's supported,
|
||||||
// see also b/25994457.
|
// see also b/25994457.
|
||||||
for (int channelCount = DEFAULT_MAX_CHANNEL_COUNT; channelCount > 0; channelCount--) {
|
for (int channelCount = DEFAULT_MAX_CHANNEL_COUNT; channelCount > 0; channelCount--) {
|
||||||
|
int channelConfig = Util.getAudioTrackChannelConfig(channelCount);
|
||||||
|
if (channelConfig == AudioFormat.CHANNEL_INVALID) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
AudioFormat audioFormat =
|
AudioFormat audioFormat =
|
||||||
new AudioFormat.Builder()
|
new AudioFormat.Builder()
|
||||||
.setEncoding(encoding)
|
.setEncoding(encoding)
|
||||||
.setSampleRate(sampleRate)
|
.setSampleRate(sampleRate)
|
||||||
.setChannelMask(Util.getAudioTrackChannelConfig(channelCount))
|
.setChannelMask(channelConfig)
|
||||||
.build();
|
.build();
|
||||||
if (AudioTrack.isDirectPlaybackSupported(audioFormat, DEFAULT_AUDIO_ATTRIBUTES)) {
|
if (AudioTrack.isDirectPlaybackSupported(audioFormat, DEFAULT_AUDIO_ATTRIBUTES)) {
|
||||||
return channelCount;
|
return channelCount;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue