Skip to content

Conversation

@KanghyunJeon
Copy link

Summary

This PR implements the feature requested in #2992.

Adds a new TrackSelectionParameters.preferredAudioChannelCount API that allows apps to prefer audio tracks with higher channel counts (e.g., 5.1, 7.1 surround) over stereo tracks, regardless of role flags (main vs alternate).

Changes

  • Add preferredAudioChannelCount field to TrackSelectionParameters
  • Add setPreferredAudioChannelCount(int) builder method
  • Modify AudioTrackInfo.compareTo() to prioritize higher channel count when preference is set
  • Reuse existing parameters and channelCount fields

Behavior

  • When preferredAudioChannelCount > 0, tracks are compared by channel count before role flags
  • Higher channel count tracks are preferred
  • Falls back to lower channel count if higher is not supported by the renderer
  • Set to 0 (default) to use original behavior based on role flags

Issue

#2992

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants