Commit 657703e4 by andrewlewis Committed by Ian Baker

Fix E-AC3 output capability check without sample rate

PiperOrigin-RevId: 432189509
(cherry picked from commit e66d0c90)
parent 71685dab
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
### dev-v2 (not yet released) ### dev-v2 (not yet released)
* Audio:
* Fix error checking audio capabilities for Dolby Atmos (E-AC3-JOC) in
HLS.
* Extractors: * Extractors:
* FMP4: Fix issue where emsg sample metadata could be output in the wrong * FMP4: Fix issue where emsg sample metadata could be output in the wrong
order for streams containing both v0 and v1 emsg atoms order for streams containing both v0 and v1 emsg atoms
......
...@@ -1730,8 +1730,11 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -1730,8 +1730,11 @@ public final class DefaultAudioSink implements AudioSink {
// the channel count for this encoding, but before then there is no way to query it so we // the channel count for this encoding, but before then there is no way to query it so we
// assume 6 channel audio is supported. // assume 6 channel audio is supported.
if (Util.SDK_INT >= 29) { if (Util.SDK_INT >= 29) {
// Default to 48 kHz if the format doesn't have a sample rate (for example, for chunkless
// HLS preparation). See [Internal: b/222127949].
int sampleRate = format.sampleRate != Format.NO_VALUE ? format.sampleRate : 48000;
channelCount = channelCount =
getMaxSupportedChannelCountForPassthroughV29(C.ENCODING_E_AC3_JOC, format.sampleRate); getMaxSupportedChannelCountForPassthroughV29(C.ENCODING_E_AC3_JOC, sampleRate);
if (channelCount == 0) { if (channelCount == 0) {
Log.w(TAG, "E-AC3 JOC encoding supported but no channel count supported"); Log.w(TAG, "E-AC3 JOC encoding supported but no channel count supported");
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment