Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6dc4b39c
authored
Jun 14, 2022
by
christosts
Committed by
Marc Baechinger
Jun 14, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Spatializer: Assume linear channel count for E-AC3 JOC streams
#minor-release PiperOrigin-RevId: 454884692
parent
1c373d51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
View file @
6dc4b39c
...
@@ -3678,10 +3678,17 @@ public class DefaultTrackSelector extends MappingTrackSelector {
...
@@ -3678,10 +3678,17 @@ public class DefaultTrackSelector extends MappingTrackSelector {
}
}
public
boolean
canBeSpatialized
(
AudioAttributes
audioAttributes
,
Format
format
)
{
public
boolean
canBeSpatialized
(
AudioAttributes
audioAttributes
,
Format
format
)
{
// For E-AC3 JOC, the format is object based. When the channel count is 16, this maps to 12
// linear channels and the rest are used for objects. See
// https://github.com/google/ExoPlayer/pull/10322#discussion_r895265881
int
linearChannelCount
=
MimeTypes
.
AUDIO_E_AC3_JOC
.
equals
(
format
.
sampleMimeType
)
&&
format
.
channelCount
==
16
?
12
:
format
.
channelCount
;
AudioFormat
.
Builder
builder
=
AudioFormat
.
Builder
builder
=
new
AudioFormat
.
Builder
()
new
AudioFormat
.
Builder
()
.
setEncoding
(
AudioFormat
.
ENCODING_PCM_16BIT
)
.
setEncoding
(
AudioFormat
.
ENCODING_PCM_16BIT
)
.
setChannelMask
(
Util
.
getAudioTrackChannelConfig
(
format
.
c
hannelCount
));
.
setChannelMask
(
Util
.
getAudioTrackChannelConfig
(
linearC
hannelCount
));
if
(
format
.
sampleRate
!=
Format
.
NO_VALUE
)
{
if
(
format
.
sampleRate
!=
Format
.
NO_VALUE
)
{
builder
.
setSampleRate
(
format
.
sampleRate
);
builder
.
setSampleRate
(
format
.
sampleRate
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment