mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Exit early progressive loads if the load task is canceled
Add an check when loading progressive media in case the load
is canceled. If the player is released very early, the progressive
media period may carry on with the initial loading unnecessarily.
PiperOrigin-RevId: 586288385
(cherry picked from commit 3d1d8f4439)
This commit is contained in:
parent
d68c36e082
commit
3f3287aba3
1 changed files with 3 additions and 0 deletions
|
|
@ -1027,6 +1027,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||
long position = positionHolder.position;
|
||||
dataSpec = buildDataSpec(position);
|
||||
long length = dataSource.open(dataSpec);
|
||||
if (loadCanceled) {
|
||||
break;
|
||||
}
|
||||
if (length != C.LENGTH_UNSET) {
|
||||
length += position;
|
||||
onLengthKnown();
|
||||
|
|
|
|||
Loading…
Reference in a new issue