Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: media/base/android/media_source_player.cc

Issue 1458783002: Fix UMA metrics for MediaSourcePlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed bug when current time is unknown Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/android/media_statistics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_source_player.cc
diff --git a/media/base/android/media_source_player.cc b/media/base/android/media_source_player.cc
index fd52bba4662fc47d321d82835ee0cffb8d295f65..8aec0ab31f907c76f5cfcae34d2b4a707390bde8 100644
--- a/media/base/android/media_source_player.cc
+++ b/media/base/android/media_source_player.cc
@@ -182,6 +182,8 @@ base::TimeDelta MediaSourcePlayer::GetDuration() {
void MediaSourcePlayer::Release() {
DVLOG(1) << __FUNCTION__;
+ media_stat_->StopAndReport(GetCurrentTime());
+
audio_decoder_job_->ReleaseDecoderResources();
video_decoder_job_->ReleaseDecoderResources();
@@ -479,7 +481,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
DVLOG(1) << __FUNCTION__ << " : decode error";
Release();
manager()->OnError(player_id(), MEDIA_ERROR_DECODE);
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
@@ -499,7 +502,9 @@ void MediaSourcePlayer::MediaDecoderCallback(
// any other pending events only after handling EOS detection.
if (IsEventPending(SEEK_EVENT_PENDING)) {
ProcessPendingEvents();
- media_stat_->StopAndReport(GetCurrentTime());
+ // In case of Seek GetCurrentTime() already tells the time to seek to.
+ if (is_clock_manager)
+ media_stat_->StopAndReport(current_presentation_timestamp);
return;
}
@@ -521,7 +526,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
}
if (status == MEDIA_CODEC_OUTPUT_END_OF_STREAM) {
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
@@ -529,7 +535,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
if (is_clock_manager)
interpolator_.StopInterpolating();
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
@@ -540,7 +547,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
} else {
is_waiting_for_key_ = true;
manager()->OnWaitingForDecryptionKey(player_id());
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
}
return;
}
@@ -559,7 +567,8 @@ void MediaSourcePlayer::MediaDecoderCallback(
// in the middle of a seek or stop event and needs to wait for the IPCs to
// come.
if (status == MEDIA_CODEC_ABORT) {
- media_stat_->StopAndReport(GetCurrentTime());
+ if (is_clock_manager)
+ media_stat_->StopAndReport(GetCurrentTime());
return;
}
« no previous file with comments | « no previous file | media/base/android/media_statistics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698