Commit 9dc5c870 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 22599a6d
...@@ -478,10 +478,13 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo ...@@ -478,10 +478,13 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo
super.releaseSourceInternal(); super.releaseSourceInternal();
mediaSourceHolders.clear(); mediaSourceHolders.clear();
mediaSourceByUid.clear(); mediaSourceByUid.clear();
playbackThreadHandler = null;
shuffleOrder = shuffleOrder.cloneAndClear(); shuffleOrder = shuffleOrder.cloneAndClear();
windowCount = 0; windowCount = 0;
periodCount = 0; periodCount = 0;
if (playbackThreadHandler != null) {
playbackThreadHandler.removeCallbacksAndMessages(null);
playbackThreadHandler = null;
}
} }
@Override @Override
...@@ -608,10 +611,6 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo ...@@ -608,10 +611,6 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private boolean handleMessage(Message msg) { private boolean handleMessage(Message msg) {
if (playbackThreadHandler == null) {
// Stale event.
return false;
}
switch (msg.what) { switch (msg.what) {
case MSG_ADD: case MSG_ADD:
MessageData<Collection<MediaSourceHolder>> addMessage = 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