Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow all supported audio codecs in ExoPlayer transcoding profile #2381

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ class ExoPlayerProfile(
* Returns all audio codecs used commonly in video containers.
* This does not include containers / codecs found in audio files
*/
private val allSupportedAudioCodecs = downmixSupportedAudioCodecs + arrayOf(
Codec.Audio.AAC_LATM,
Codec.Audio.ALAC,
Codec.Audio.AC3,
Codec.Audio.EAC3,
Codec.Audio.DCA,
Codec.Audio.DTS,
Codec.Audio.MLP,
Codec.Audio.TRUEHD,
Codec.Audio.PCM_ALAW,
Codec.Audio.PCM_MULAW,
)
private val allSupportedAudioCodecs = buildList {
addAll(downmixSupportedAudioCodecs)
add(Codec.Audio.AAC_LATM)
add(Codec.Audio.ALAC)
if (isAC3Enabled) add(Codec.Audio.AC3)
if (isAC3Enabled) add(Codec.Audio.EAC3)
add(Codec.Audio.DCA)
add(Codec.Audio.DTS)
add(Codec.Audio.MLP)
add(Codec.Audio.TRUEHD)
add(Codec.Audio.PCM_ALAW)
add(Codec.Audio.PCM_MULAW)
}.toTypedArray()

init {
name = "AndroidTV-ExoPlayer"
Expand All @@ -65,10 +66,9 @@ class ExoPlayerProfile(
if (deviceHevcCodecProfile.ContainsCodec(Codec.Video.HEVC, Codec.Container.TS)) add(Codec.Video.HEVC)
add(Codec.Video.H264)
}.joinToString(",")
audioCodec = buildList {
if (isAC3Enabled) add(Codec.Audio.AC3)
add(Codec.Audio.AAC)
add(Codec.Audio.MP3)
audioCodec = when {
Utils.downMixAudio(context) -> downmixSupportedAudioCodecs
else -> allSupportedAudioCodecs
}.joinToString(",")
protocol = "hls"
copyTimestamps = false
Expand Down