mirror of
https://github.com/androidx/media.git
synced 2025-05-05 22:50:57 +08:00
Ignore format changes arriving after the media has been removed.
PiperOrigin-RevId: 426089165
This commit is contained in:
parent
9e3eb6c5f7
commit
4112a99f49
@ -237,6 +237,11 @@ public final class MediaMetricsListener
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDownstreamFormatChanged(EventTime eventTime, MediaLoadData mediaLoadData) {
|
public void onDownstreamFormatChanged(EventTime eventTime, MediaLoadData mediaLoadData) {
|
||||||
|
if (eventTime.mediaPeriodId == null) {
|
||||||
|
// This event arrived after the media has been removed from the playlist or a custom
|
||||||
|
// MediaSource forgot to set the right id. Ignore the track change in these cases.
|
||||||
|
return;
|
||||||
|
}
|
||||||
PendingFormatUpdate update =
|
PendingFormatUpdate update =
|
||||||
new PendingFormatUpdate(
|
new PendingFormatUpdate(
|
||||||
checkNotNull(mediaLoadData.trackFormat),
|
checkNotNull(mediaLoadData.trackFormat),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user