Commit 32b4db36 by tonihei Committed by Andrew Lewis

Send empty timeline for empty DynamicConcatenatingMediaSource immediately.

Without child sources, the timeline can't possibly updated again within the
current looper message. Thus, we can send the empty timeline immediately.

This fixes a recently introduced flakiness in the test.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187295700
parent 38914f0b
...@@ -322,9 +322,13 @@ public final class DynamicConcatenatingMediaSource extends CompositeMediaSource< ...@@ -322,9 +322,13 @@ public final class DynamicConcatenatingMediaSource extends CompositeMediaSource<
public synchronized void prepareSourceInternal(ExoPlayer player, boolean isTopLevelSource) { public synchronized void prepareSourceInternal(ExoPlayer player, boolean isTopLevelSource) {
super.prepareSourceInternal(player, isTopLevelSource); super.prepareSourceInternal(player, isTopLevelSource);
this.player = player; this.player = player;
shuffleOrder = shuffleOrder.cloneAndInsert(0, mediaSourcesPublic.size()); if (mediaSourcesPublic.isEmpty()) {
addMediaSourcesInternal(0, mediaSourcesPublic); notifyListener();
scheduleListenerNotification(/* actionOnCompletion= */ null); } else {
shuffleOrder = shuffleOrder.cloneAndInsert(0, mediaSourcesPublic.size());
addMediaSourcesInternal(0, mediaSourcesPublic);
scheduleListenerNotification(/* actionOnCompletion= */ null);
}
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment