mirror of
https://github.com/androidx/media.git
synced 2025-05-17 20:49:53 +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);
|
/* startPositionUs= */ 0);
|
||||||
mediaPeriods[i] = mediaPeriod;
|
mediaPeriods[i] = mediaPeriod;
|
||||||
pendingMediaPeriods.add(mediaPeriod);
|
pendingMediaPeriods.add(mediaPeriod);
|
||||||
|
}
|
||||||
|
for (MediaPeriod mediaPeriod : mediaPeriods) {
|
||||||
mediaPeriod.prepare(/* callback= */ this, /* positionUs= */ 0);
|
mediaPeriod.prepare(/* callback= */ this, /* positionUs= */ 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user