selectAudio

fun selectAudio(streams: List<StreamInfo>, programs: List<Program>, video: StreamInfo?): StreamInfo?

The audio stream to play beside video, or null when there is none (#165).

programs are the source's MediaSource.programs. When video sits in a programme, the candidates are the audio streams of streams that share one of its programmes or, when those programmes hold no audio, the ones that sit in no programme. Audio that only other programmes hold is never a candidate, so a multiplex never plays one channel's picture with another channel's sound. With no programmes, a null video or a video in no programme, every audio stream is a candidate, as in the selectAudio that takes the streams alone. The audio rules of TrackSelector then pick among the candidates.


The audio stream to play from streams, or null when there is none. It knows nothing of programmes, so for a source that has them use the selectAudio that takes the picture and the programmes.