Skip to content

Commit 52e2808

Browse files
committed
[duplicated subtitle] Fix the issue of duplicated subtitles on the screen display (with ExoPlayer module).
- Replace StreamInfo.getSubtitles() with AppStreamInfo.loadNormalizedSubtitles() to download TTML subtitles and deduplicate them. - Note: each module calling subtitle normalization will perform network download independently. AppStreamInfo cannot be shared across modules like StreamInfo.
1 parent 0fadb57 commit 52e2808

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/src/main/java/org/schabi/newpipe/player/resolver/VideoPlaybackResolver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.schabi.newpipe.player.helper.PlayerHelper;
2222
import org.schabi.newpipe.player.mediaitem.MediaItemTag;
2323
import org.schabi.newpipe.player.mediaitem.StreamInfoTag;
24+
import org.schabi.newpipe.streams.AppStreamInfo;
2425
import org.schabi.newpipe.util.ListHelper;
2526

2627
import java.util.ArrayList;
@@ -136,7 +137,8 @@ public MediaSource resolve(@NonNull final StreamInfo info) {
136137
// Below are auxiliary media sources
137138

138139
// Create subtitle sources
139-
final List<SubtitlesStream> subtitlesStreams = info.getSubtitles();
140+
final AppStreamInfo appInfo = AppStreamInfo.from(info);
141+
final List<SubtitlesStream> subtitlesStreams = appInfo.loadNormalizedSubtitles();
140142
if (subtitlesStreams != null) {
141143
// Torrent and non URL subtitles are not supported by ExoPlayer
142144
final List<SubtitlesStream> nonTorrentAndUrlStreams = getUrlAndNonTorrentStreams(

0 commit comments

Comments
 (0)