Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repro unit test for Exoplayer bug with multiple non-internal events. #11392

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
import com.google.android.exoplayer2.testutil.FakeVideoRenderer;
import com.google.android.exoplayer2.testutil.TestExoPlayerBuilder;
import com.google.android.exoplayer2.text.TextOutput;
import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
import com.google.android.exoplayer2.trackselection.TrackSelectorResult;
import com.google.android.exoplayer2.upstream.Allocation;
import com.google.android.exoplayer2.upstream.Allocator;
import com.google.android.exoplayer2.upstream.Loader;
Expand Down Expand Up @@ -12972,6 +12974,38 @@ public void replaceMediaItems_replacingCurrentItem_correctMasking() throws Excep
player.release();
}

@SuppressWarnings("deprecation") // Testing deprecated listener call.
@Test
public void rendererError_whileReadingAhead_multipleNonInternalEvents() throws Exception {
// Creating a PlaybackInfo instance with dummy/placeholder values
Timeline dummyTimeline = Timeline.EMPTY;
MediaPeriodId dummyMediaPeriodId = new MediaPeriodId(new Object());
long dummyStartPosition = 0L;
long dummyContentPosition = 0L;
int dummyPlaybackState = 0;
ExoPlaybackException dummyExoPlaybackException = null;
boolean dummyPlayWhenReady = false;
TrackGroupArray dummyTrackGroups = TrackGroupArray.EMPTY;
TrackSelectorResult dummyTrackSelectorResult = new TrackSelectorResult(new RendererConfiguration[]{}, new ExoTrackSelection[]{}, new int[]{});
List<Metadata> dummyMetadataList = Collections.emptyList();
boolean dummyIsLoading = false;
int dummyOffloadSchedulingDelayMs = 0;
PlaybackParameters dummyPlaybackParameters = PlaybackParameters.DEFAULT;
long dummyTotalBufferedDuration = 0L;
long dummyPositionUs = 0L;
long dummyBufferedPositionUs = 0L;
long dummyActions = 0L;
boolean dummyIsPlaying = false;

PlaybackInfo mockPlaybackInfo = new PlaybackInfo(dummyTimeline, dummyMediaPeriodId, dummyStartPosition, dummyContentPosition, dummyPlaybackState, dummyExoPlaybackException, dummyPlayWhenReady, dummyTrackGroups, dummyTrackSelectorResult, dummyMetadataList, dummyMediaPeriodId, dummyIsLoading, dummyOffloadSchedulingDelayMs, dummyPlaybackParameters, dummyTotalBufferedDuration, dummyPositionUs, dummyBufferedPositionUs, dummyActions, dummyIsPlaying);
ExoPlayerImplInternal.PlaybackInfoUpdate playbackInfoUpdate = new ExoPlayerImplInternal.PlaybackInfoUpdate(mockPlaybackInfo);

// rapidly set position discontinuity
playbackInfoUpdate.setPositionDiscontinuity(Player.DISCONTINUITY_REASON_SEEK);
playbackInfoUpdate.setPositionDiscontinuity(Player.DISCONTINUITY_REASON_INTERNAL);
playbackInfoUpdate.setPositionDiscontinuity(Player.DISCONTINUITY_REASON_SEEK);
}

@SuppressWarnings("deprecation") // Testing deprecated listener call.
@Test
public void replaceMediaItems_replacingCurrentItemWithEmptyListAndSubsequentItem_correctMasking()
Expand Down