Commit fcda01eb by tonihei Committed by Oliver Woodman

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
parent 1900e941
......@@ -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 =
......
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