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) { /** Set audio track to be used the next time {@link #resolve(StreamInfo)} is called.
this.audioTrack = audioLanguage; *
* @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; this.playbackQuality = playbackQuality;
} }
@Nullable /** Set audio track to be used the next time {@link #resolve(StreamInfo, SelectedPlayer)}
public String getAudioTrack() { * is called.
return audioTrack; *
} * @param audioTrack the {@link AudioStream} audioTrackId that should be selected on resolve
*/
public void setAudioTrack(@Nullable final String audioLanguage) { public void setAudioTrack(@Nullable final String audioTrack) {
this.audioTrack = audioLanguage; this.audioTrack = audioTrack;
} }
} }

View File

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