Commit d308fff8 by tonihei Committed by Oliver Woodman

Restructure media period queue tracker in AnalyticsCollector.

The current structure tries to associate events to media periods and windows
based on the reported values and the current timeline. However the reported
EventTime may not always be consistent in case the timeline doesn't contain
windows or media periods yet or not anymore.

The recent changes to MediaPeriodId allow to use it as a unique identifer for
media periods independent of the timeline. This enables more accurate tracking
of the media period queue and prevents reporting events with inconsistent
data.

Issue:#4492
Issue:#4634

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210713120
parent ca0e2767
......@@ -133,6 +133,9 @@
* Provide additional information for adaptive track selection.
`TrackSelection.updateSelectedTrack` has two new parameters for the current
queue of media chunks and iterators for information about upcoming chunks.
* Prevent potential issues when reporting events for multi-period media sources
([#4492](https://github.com/google/ExoPlayer/issues/4492) and
[#4634](https://github.com/google/ExoPlayer/issues/4634)).
### 2.8.4 ###
......
......@@ -619,7 +619,7 @@ public final class AnalyticsCollectorTest {
.containsExactly(window0Period1Seq0, window1Period0Seq1);
assertThat(listener.getEvents(EVENT_MEDIA_PERIOD_CREATED))
.containsExactly(window0Period1Seq0, window1Period0Seq1);
assertThat(listener.getEvents(EVENT_MEDIA_PERIOD_RELEASED)).containsExactly(period0Seq1);
assertThat(listener.getEvents(EVENT_MEDIA_PERIOD_RELEASED)).containsExactly(window1Period0Seq1);
assertThat(listener.getEvents(EVENT_READING_STARTED))
.containsExactly(window0Period1Seq0, window1Period0Seq1);
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
......
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