Skip to content

Commit

Permalink
🚑 (HLS): Add support for multiple tracks of same type; ref T6222 Clie…
Browse files Browse the repository at this point in the history
…nt software & devices

Issue on github: google#2014
Original commit: stari4ek@ce66b33

Auditors: alex3d
  • Loading branch information
Alexander committed Aug 5, 2021
1 parent 80332f7 commit 1b9bfc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ public final class TsExtractor implements Extractor {
private static final int BUFFER_SIZE = TS_PACKET_SIZE * 50;
private static final int SNIFF_TS_PACKET_COUNT = 5;

// Custom fix: https://github.com/google/ExoPlayer/issues/2014
public static boolean HLS_MULTIPLE_TRACKS_ALLOWED = true;

private final @Mode int mode;
private final int timestampSearchBytes;
private final List<TimestampAdjuster> timestampAdjusters;
Expand Down Expand Up @@ -635,7 +638,8 @@ public void consume(ParsableByteArray sectionData) {
}
remainingEntriesLength -= esInfoLength + 5;

int trackId = mode == MODE_HLS ? streamType : elementaryPid;
// Custom fix: https://github.com/google/ExoPlayer/issues/2014
int trackId = mode == MODE_HLS && !HLS_MULTIPLE_TRACKS_ALLOWED ? streamType : elementaryPid;
if (trackIds.get(trackId)) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ public interface Callback extends SequenceableLoader.Callback<HlsSampleStreamWra
public static final int SAMPLE_QUEUE_INDEX_NO_MAPPING_FATAL = -2;
public static final int SAMPLE_QUEUE_INDEX_NO_MAPPING_NON_FATAL = -3;

private static final Set<Integer> MAPPABLE_TYPES =
Collections.unmodifiableSet(
new HashSet<>(
Arrays.asList(C.TRACK_TYPE_AUDIO, C.TRACK_TYPE_VIDEO, C.TRACK_TYPE_METADATA)));
// Custom fix: https://github.com/google/ExoPlayer/issues/2014
private static final Set<Integer> MAPPABLE_TYPES = Collections.emptySet();

private final int trackType;
private final Callback callback;
Expand Down

0 comments on commit 1b9bfc9

Please sign in to comment.