mirror of
https://github.com/samsonjs/media.git
synced 2026-04-19 13:35:47 +00:00
parent
8a723706d6
commit
6ef8c3a61b
1 changed files with 11 additions and 2 deletions
|
|
@ -191,14 +191,23 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
|
|||
downstreamMediaFormats[track] = null;
|
||||
pendingDiscontinuities[track] = false;
|
||||
downstreamFormat = null;
|
||||
boolean wasLoadControlRegistered = loadControlRegistered;
|
||||
if (!loadControlRegistered) {
|
||||
loadControl.register(this, bufferSizeContribution);
|
||||
loadControlRegistered = true;
|
||||
}
|
||||
if (enabledTrackCount == 1) {
|
||||
downstreamPositionUs = positionUs;
|
||||
lastSeekPositionUs = positionUs;
|
||||
restartFrom(positionUs);
|
||||
if (wasLoadControlRegistered && downstreamPositionUs == positionUs) {
|
||||
// TODO: Address [Internal: b/21743989] to remove the need for this kind of hack.
|
||||
// This is the first track to be enabled after preparation and the position is the same as
|
||||
// was passed to prepare. In this case we can avoid restarting, which would reload the same
|
||||
// chunks as were loaded during preparation.
|
||||
maybeStartLoading();
|
||||
} else {
|
||||
downstreamPositionUs = positionUs;
|
||||
restartFrom(positionUs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue