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
This commit is contained in:
tonihei 2022-01-19 14:26:49 +00:00 committed by Ian Baker
parent 491ac8f066
commit 24e77a3393

View File

@ -594,6 +594,12 @@ public final class MediaMetricsListener
playbackSession.reportPlaybackMetrics(metricsBuilder.build());
metricsBuilder = null;
activeSessionId = null;
audioUnderruns = 0;
droppedFrames = 0;
playedFrames = 0;
currentVideoFormat = null;
currentAudioFormat = null;
currentTextFormat = null;
}
private static int getTrackChangeReason(@C.SelectionReason int trackSelectionReason) {