resolver: document the `audioTrack` setters better

This commit is contained in:
Profpatsch 2024-01-07 19:57:21 +01:00
parent e242ad42a8
commit d134219da5
3 changed files with 15 additions and 10 deletions

View File

@ -96,7 +96,11 @@ public class AudioPlaybackResolver implements PlaybackResolver {
}
}
public void setAudioTrack(@Nullable final String audioLanguage) {
this.audioTrack = audioLanguage;
/** Set audio track to be used the next time {@link #resolve(StreamInfo)} is called.
*
* @param audioTrack the {@link AudioStream} audioTrackId that should be selected on resolve
*/
public void setAudioTrack(@Nullable final String audioTrack) {
this.audioTrack = audioTrack;
}
}

View File

@ -218,12 +218,12 @@ public class VideoPlaybackResolver implements PlaybackResolver {
this.playbackQuality = playbackQuality;
}
@Nullable
public String getAudioTrack() {
return audioTrack;
}
public void setAudioTrack(@Nullable final String audioLanguage) {
this.audioTrack = audioLanguage;
/** Set audio track to be used the next time {@link #resolve(StreamInfo, SelectedPlayer)}
* is called.
*
* @param audioTrack the {@link AudioStream} audioTrackId that should be selected on resolve
*/
public void setAudioTrack(@Nullable final String audioTrack) {
this.audioTrack = audioTrack;
}
}

View File

@ -121,12 +121,13 @@ public final class ListHelper {
* .
* @param context
* @param audioStreams
* @param trackId ???
* @param trackId Try to find this #AudioStream.getAudioTrackId in the audioStreams & select it
* @return index to play, or -1 if audioStreams is empty.
*/
public static int getAudioFormatIndex(final Context context,
@NonNull final List<AudioStream> audioStreams,
@Nullable final String trackId) {
// if we were given a trackId, try to select that before going to the defaults.
if (trackId != null) {
for (int i = 0; i < audioStreams.size(); i++) {
final AudioStream s = audioStreams.get(i);