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

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

Issue 898843002: Use cached Key frames to avoid browser seek (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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
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 53df8d3e6588cb72eae6696c4642d7ee86050a1c..c3755ccd6e00b970d85a704c8f4f85b3dd306f04 100644
--- a/media/base/android/media_source_player.cc
+++ b/media/base/android/media_source_player.cc
@@ -564,7 +564,7 @@ void MediaSourcePlayer::DecodeMoreAudio() {
DCHECK(!audio_decoder_job_->is_decoding());
DCHECK(!AudioFinished());
- if (audio_decoder_job_->Decode(
+ if (MediaDecoderJob::STATUS_SUCCESS == audio_decoder_job_->Decode(
wolenetz 2015/02/04 21:07:23 nit: here and in DecodeMoreVideo(), use a switch t
qinmin 2015/02/04 23:11:23 Done.
start_time_ticks_,
start_presentation_timestamp_,
base::Bind(&MediaSourcePlayer::MediaDecoderCallback, weak_this_, true))) {
@@ -583,18 +583,19 @@ void MediaSourcePlayer::DecodeMoreVideo() {
DCHECK(!video_decoder_job_->is_decoding());
DCHECK(!VideoFinished());
- if (video_decoder_job_->Decode(
+ MediaDecoderJob::MediaDecoderJobStatus status = video_decoder_job_->Decode(
start_time_ticks_,
start_presentation_timestamp_,
base::Bind(&MediaSourcePlayer::MediaDecoderCallback, weak_this_,
- false))) {
+ false));
+ if (status == MediaDecoderJob::STATUS_SUCCESS) {
TRACE_EVENT_ASYNC_BEGIN0("media", "MediaSourcePlayer::DecodeMoreVideo",
video_decoder_job_.get());
return;
}
// If the decoder is waiting for iframe, trigger a browser seek.
- if (!video_decoder_job_->next_video_data_is_iframe()) {
+ if (status == MediaDecoderJob::STATUS_KEY_FRAME_REQUIRED) {
BrowserSeekToCurrentTime();
return;
}

Powered by Google App Engine
This is Rietveld 408576698