-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -376,7 +376,6 @@ public int[] getSupportedTypes() { | |
|
||
private int staleManifestReloadAttempt; | ||
private long expiredManifestPublishTimeUs; | ||
private boolean dynamicMediaPresentationEnded; | ||
|
||
private int firstPeriodId; | ||
|
||
|
@@ -679,7 +678,6 @@ public void releaseSourceInternal() { | |
elapsedRealtimeOffsetMs = 0; | ||
staleManifestReloadAttempt = 0; | ||
expiredManifestPublishTimeUs = C.TIME_UNSET; | ||
dynamicMediaPresentationEnded = false; | ||
firstPeriodId = 0; | ||
periodsById.clear(); | ||
} | ||
|
@@ -691,10 +689,6 @@ public void releaseSourceInternal() { | |
startLoadingManifest(); | ||
} | ||
|
||
/* package */ void onDashLiveMediaPresentationEndSignalEncountered() { | ||
this.dynamicMediaPresentationEnded = true; | ||
} | ||
|
||
/* package */ void onDashManifestPublishTimeExpired(long expiredManifestPublishTimeUs) { | ||
if (this.expiredManifestPublishTimeUs == C.TIME_UNSET | ||
|| this.expiredManifestPublishTimeUs < expiredManifestPublishTimeUs) { | ||
|
@@ -734,9 +728,8 @@ public void releaseSourceInternal() { | |
// behind. | ||
Log.w(TAG, "Loaded out of sync manifest"); | ||
isManifestStale = true; | ||
} else if (dynamicMediaPresentationEnded | ||
|| (expiredManifestPublishTimeUs != C.TIME_UNSET | ||
&& newManifest.publishTimeMs * 1000 <= expiredManifestPublishTimeUs)) { | ||
} else if (expiredManifestPublishTimeUs != C.TIME_UNSET | ||
&& newManifest.publishTimeMs * 1000 <= expiredManifestPublishTimeUs) { | ||
// If we receive a dynamic manifest that's older than expected (i.e. its publish time has | ||
// expired, or it's dynamic and we know the presentation has ended), then this manifest is | ||
// stale. | ||
|
@@ -745,8 +738,6 @@ public void releaseSourceInternal() { | |
"Loaded stale dynamic manifest: " | ||
+ newManifest.publishTimeMs | ||
+ ", " | ||
+ dynamicMediaPresentationEnded | ||
+ ", " | ||
+ expiredManifestPublishTimeUs); | ||
isManifestStale = true; | ||
} | ||
|
@@ -763,7 +754,6 @@ public void releaseSourceInternal() { | |
staleManifestReloadAttempt = 0; | ||
} | ||
|
||
|
||
manifest = newManifest; | ||
manifestLoadPending &= manifest.dynamic; | ||
manifestLoadStartTimestampMs = elapsedRealtimeMs - loadDurationMs; | ||
|
@@ -1175,7 +1165,10 @@ public Window getWindow( | |
presentationStartTimeMs, | ||
windowStartTimeMs, | ||
/* isSeekable= */ true, | ||
manifest.dynamic, | ||
// TODO: Split so that we can disambiguate between dynamic cases where media may be | ||
// appended, and those where media can only be removed. The former should not prevent | ||
// transition to the ended state. | ||
manifest.dynamic && manifest.minUpdatePeriodMs != C.TIME_UNSET, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
peddisri
Contributor
|
||
windowDefaultStartPositionUs, | ||
windowDurationUs, | ||
/* firstPeriodIndex= */ 0, | ||
|
@@ -1253,11 +1246,6 @@ public void onDashManifestRefreshRequested() { | |
public void onDashManifestPublishTimeExpired(long expiredManifestPublishTimeUs) { | ||
DashMediaSource.this.onDashManifestPublishTimeExpired(expiredManifestPublishTimeUs); | ||
} | ||
|
||
@Override | ||
public void onDashLiveMediaPresentationEndSignalEncountered() { | ||
DashMediaSource.this.onDashLiveMediaPresentationEndSignalEncountered(); | ||
} | ||
} | ||
|
||
private final class ManifestCallback implements Loader.Callback<ParsingLoadable<DashManifest>> { | ||
|
1 comment
on commit f70cc75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's quite a lot of change. Let me go through it and test. Thanks for the patch.
Edit to
manifest.dynamic && manifest.durationMs == C.TIME_UNSET
for testing.In a final version, I'd propose adding a new
Timeline.Window.isEnded
field.isDynamic
will keep its existing meaning (and be set as in this change).isEnded
will be set to!manifest.dynamic || manifest.durationMs != C.TIME_UNSET
, and will mean that no further media will be appended. IfisEnded
andisDynamic
are both true, that indicates a window that may be getting smaller, but to which nothing will be appended (and so transitioning toSTATE_ENDED
should be allowed).