mirror of
https://github.com/androidx/media.git
synced 2025-05-17 12:39:52 +08: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
@ -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…
x
Reference in New Issue
Block a user