mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix HLS Timeline.isDynamic
- Also fix an issue that allowed blacklisting of all tracks, due to incorrect index being used. - Also fix an issue with track deselection for HLS. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132882151
This commit is contained in:
parent
2da35769ff
commit
26e1306639
2 changed files with 4 additions and 3 deletions
|
|
@ -163,7 +163,8 @@ import java.util.List;
|
||||||
mayRetainStreamFlags, childStreams, streamResetFlags, !seenFirstTrackSelection);
|
mayRetainStreamFlags, childStreams, streamResetFlags, !seenFirstTrackSelection);
|
||||||
boolean wrapperEnabled = false;
|
boolean wrapperEnabled = false;
|
||||||
for (int j = 0; j < selections.length; j++) {
|
for (int j = 0; j < selections.length; j++) {
|
||||||
if (selectionChildIndices[j] == i) {
|
if (selectionChildIndices[j] == i
|
||||||
|
|| (selectionChildIndices[j] == C.INDEX_UNSET && streamChildIndices[j] == i)) {
|
||||||
streams[j] = childStreams[j];
|
streams[j] = childStreams[j];
|
||||||
if (childStreams[j] != null) {
|
if (childStreams[j] != null) {
|
||||||
wrapperEnabled = true;
|
wrapperEnabled = true;
|
||||||
|
|
@ -291,7 +292,7 @@ import java.util.List;
|
||||||
callback.onPrepared(this);
|
callback.onPrepared(this);
|
||||||
|
|
||||||
// TODO[playlists]: Calculate the window.
|
// TODO[playlists]: Calculate the window.
|
||||||
Timeline timeline = new SinglePeriodTimeline(durationUs, !isLive);
|
Timeline timeline = new SinglePeriodTimeline(durationUs, durationUs, 0, 0, !isLive, isLive);
|
||||||
sourceListener.onSourceInfoRefreshed(timeline, playlist);
|
sourceListener.onSourceInfoRefreshed(timeline, playlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ public abstract class BaseTrackSelection implements TrackSelection {
|
||||||
long nowMs = SystemClock.elapsedRealtime();
|
long nowMs = SystemClock.elapsedRealtime();
|
||||||
boolean canBlacklist = isBlacklisted(index, nowMs);
|
boolean canBlacklist = isBlacklisted(index, nowMs);
|
||||||
for (int i = 0; i < length && !canBlacklist; i++) {
|
for (int i = 0; i < length && !canBlacklist; i++) {
|
||||||
canBlacklist = i != index && !isBlacklisted(index, nowMs);
|
canBlacklist = i != index && !isBlacklisted(i, nowMs);
|
||||||
}
|
}
|
||||||
if (!canBlacklist) {
|
if (!canBlacklist) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue