mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Merge pull request #728 from lawadr:audio-capabilities-fix
PiperOrigin-RevId: 574829263 (cherry picked from commit 5f80a4708165ffe977ce37400f7c8eae01142e2d)
This commit is contained in:
parent
a8b0bd712a
commit
cb67b16cac
@ -15,6 +15,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…
x
Reference in New Issue
Block a user