Remove messages on release of ConcatenatingMediaSource.

That was previously handled by the player. But since we switched to Handler
messages instead of player messages, we should do that manually.

PiperOrigin-RevId: 229341747
This commit is contained in:
tonihei 2019-01-15 11:07:05 +00:00 committed by Oliver Woodman
parent 1900e94144
commit fcda01eb5c

View file

@ -473,10 +473,13 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo
super.releaseSourceInternal();
mediaSourceHolders.clear();
mediaSourceByUid.clear();
playbackThreadHandler = null;
shuffleOrder = shuffleOrder.cloneAndClear();
windowCount = 0;
periodCount = 0;
if (playbackThreadHandler != null) {
playbackThreadHandler.removeCallbacksAndMessages(null);
playbackThreadHandler = null;
}
}
@Override
@ -603,10 +606,6 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo
@SuppressWarnings("unchecked")
private boolean handleMessage(Message msg) {
if (playbackThreadHandler == null) {
// Stale event.
return false;
}
switch (msg.what) {
case MSG_ADD:
MessageData<Collection<MediaSourceHolder>> addMessage =