Skip to content

Commit

Permalink
Fix audio track selection when baking subtitles
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Nov 3, 2024
1 parent ef236c8 commit f474e2a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,13 @@ private VideoOptions buildExoPlayerOptions(@Nullable Integer forcedSubtitleIndex
internalOptions.setMaxBitrate(maxBitrate);
if (playbackRetries > 0 || (isLiveTv && !directStreamLiveTv)) internalOptions.setEnableDirectStream(false);
if (playbackRetries > 1) internalOptions.setEnableDirectPlay(false);
internalOptions.setSubtitleStreamIndex(forcedSubtitleIndex);
if (mCurrentOptions != null) {
internalOptions.setSubtitleStreamIndex(mCurrentOptions.getSubtitleStreamIndex());
internalOptions.setAudioStreamIndex(mCurrentOptions.getAudioStreamIndex());
}
if (forcedSubtitleIndex != null) {
internalOptions.setSubtitleStreamIndex(forcedSubtitleIndex);
}
MediaSourceInfo currentMediaSource = getCurrentMediaSource();
if (!isLiveTv && currentMediaSource != null) {
internalOptions.setMediaSourceId(currentMediaSource.getId());
Expand Down

0 comments on commit f474e2a

Please sign in to comment.