mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Fix OOM-is-prevented test OOM-ing :)
This test is intended to check that DefaultLoadControl will cause playback to fail as "stuck buffering" rather than OOM-ing, in the case that its target buffer size is reached and playback still hasn't started. Unfortunately, the target buffer size is ~130MB, and when running on some setups an OOM actually ends up happening before this much memory is allocated. This change makes the target buffer size much smaller to avoid the problem. PiperOrigin-RevId: 331748208
This commit is contained in:
parent
9a01e6cf1e
commit
8386d617bf
1 changed files with 5 additions and 0 deletions
|
|
@ -7330,6 +7330,10 @@ public final class ExoPlayerTest {
|
|||
@Test
|
||||
public void
|
||||
infiniteLoading_withSmallAllocations_oomIsPreventedByLoadControl_andThrowsStuckBufferingIllegalStateException() {
|
||||
DefaultLoadControl loadControl =
|
||||
new DefaultLoadControl.Builder()
|
||||
.setTargetBufferBytes(10 * C.DEFAULT_BUFFER_SEGMENT_SIZE)
|
||||
.build();
|
||||
MediaSource continuouslyAllocatingMediaSource =
|
||||
new FakeMediaSource(
|
||||
new FakeTimeline(/* windowCount= */ 1), ExoPlayerTestRunner.VIDEO_FORMAT) {
|
||||
|
|
@ -7387,6 +7391,7 @@ public final class ExoPlayerTest {
|
|||
new ExoPlayerTestRunner.Builder(context)
|
||||
.setActionSchedule(actionSchedule)
|
||||
.setMediaSources(continuouslyAllocatingMediaSource)
|
||||
.setLoadControl(loadControl)
|
||||
.build();
|
||||
|
||||
ExoPlaybackException exception =
|
||||
|
|
|
|||
Loading…
Reference in a new issue