Commit b2ecce4d by tonihei Committed by Ian Baker

Reset some state values when a session is finished.

Currently, we keep the values for dropped/played frames, audio underruns
and current formats from the last session, causing double reporting
of counters and wrong track change reasons for formats. All these
values should be reset when the active session is finished, so that the
new session can start from scratch.

PiperOrigin-RevId: 422798406
parent d15350ab
...@@ -592,6 +592,12 @@ public final class MediaMetricsListener ...@@ -592,6 +592,12 @@ public final class MediaMetricsListener
playbackSession.reportPlaybackMetrics(metricsBuilder.build()); playbackSession.reportPlaybackMetrics(metricsBuilder.build());
metricsBuilder = null; metricsBuilder = null;
activeSessionId = null; activeSessionId = null;
audioUnderruns = 0;
droppedFrames = 0;
playedFrames = 0;
currentVideoFormat = null;
currentAudioFormat = null;
currentTextFormat = null;
} }
private static int getTrackChangeReason(@C.SelectionReason int trackSelectionReason) { private static int getTrackChangeReason(@C.SelectionReason int trackSelectionReason) {
......
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