mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Do not prepare MediaPeriods in a loop.
They may prepare immediately and let pendingMediaPeriods become empty before all other periods are even created. PiperOrigin-RevId: 232675283
This commit is contained in:
parent
a6c1dbe156
commit
f898bddbfc
1 changed files with 2 additions and 0 deletions
|
|
@ -834,6 +834,8 @@ public final class DownloadHelper {
|
|||
/* startPositionUs= */ 0);
|
||||
mediaPeriods[i] = mediaPeriod;
|
||||
pendingMediaPeriods.add(mediaPeriod);
|
||||
}
|
||||
for (MediaPeriod mediaPeriod : mediaPeriods) {
|
||||
mediaPeriod.prepare(/* callback= */ this, /* positionUs= */ 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue