Skip to content

Commit a8b6af7

Browse files
rbessick4varund7726
authored andcommitted
Move an orphaned analytics reference under a mutex
Bug: 167695677 Bug: 151644303 Test: poc from bugs Merged-In: I75f29a6254c5eab5d4f524ee7a7ef59f93a0b405 Change-Id: I0a5a532e9e96baf95efc2b82dba07adc7baf4930 (cherry picked from commit 8e4dd95f57ac2f3e675527ec7c77977889dc3cb3)
1 parent b289749 commit a8b6af7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ void NuPlayerDriver::updateMetrics(const char *where) {
553553
// getDuration() uses mLock
554554
int duration_ms = -1;
555555
getDuration(&duration_ms);
556-
mAnalyticsItem->setInt64(kPlayerDuration, duration_ms);
557556

558557
mPlayer->updateInternalTimers();
559558

@@ -575,13 +574,14 @@ void NuPlayerDriver::updateMetrics(const char *where) {
575574
// we also avoid any races within mAnalyticsItem machinery
576575
Mutex::Autolock autoLock(mMetricsLock);
577576

577+
mAnalyticsItem->setInt64(kPlayerDuration, duration_ms);
578+
578579
mAnalyticsItem->setInt64(kPlayerPlaying, (playingTimeUs+500)/1000 );
579580

580581
if (mRebufferingEvents != 0) {
581582
mAnalyticsItem->setInt64(kPlayerRebuffering, (rebufferingTimeUs+500)/1000 );
582583
mAnalyticsItem->setInt32(kPlayerRebufferingCount, rebufferingEvents);
583584
mAnalyticsItem->setInt32(kPlayerRebufferingAtExit, rebufferingAtExit);
584-
585585
}
586586

587587
mAnalyticsItem->setCString(kPlayerDataSourceType, mPlayer->getDataSourceType());

0 commit comments

Comments
 (0)