Merge #5126: fix(playlist): always call onCompletion when moving media sources

Imported from GitHub PR https://github.com/google/ExoPlayer/pull/5126

Closes #5125
Merge 55a4c1e15de7f100f37e38119f1da360910fd1e3 into fe41f17c387b7c18a818c8cf2a1ebcdfbd36836a

PiperOrigin-RevId: 222612873
This commit is contained in:
BrainCrumbz 2018-11-23 12:36:43 +00:00 committed by Oliver Woodman
parent 3039c358cc
commit e99c904179

View File

@ -365,6 +365,9 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo
public final synchronized void moveMediaSource(
int currentIndex, int newIndex, @Nullable Runnable actionOnCompletion) {
if (currentIndex == newIndex) {
if (actionOnCompletion != null) {
actionOnCompletion.run();
}
return;
}
mediaSourcesPublic.add(newIndex, mediaSourcesPublic.remove(currentIndex));