mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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:
parent
1900e94144
commit
fcda01eb5c
1 changed files with 4 additions and 5 deletions
|
|
@ -473,10 +473,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
|
||||||
|
|
@ -603,10 +606,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 =
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue