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

Unified Diff: media/base/pipeline.cc

Issue 710693003: Report PIPELINE_ERROR_DECODE when SourceState::Append fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « media/base/pipeline.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline.cc
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index 059710525372976dad8118a21e144fc6542d154c..731cf5a2ca9d26ad923e863c985d3fbc17ebaac8 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -39,7 +39,6 @@ Pipeline::Pipeline(
volume_(1.0f),
playback_rate_(0.0f),
status_(PIPELINE_OK),
- is_initialized_(false),
state_(kCreated),
renderer_ended_(false),
text_renderer_ended_(false),
@@ -297,6 +296,14 @@ void Pipeline::SetDuration(TimeDelta duration) {
void Pipeline::OnStateTransition(PipelineStatus status) {
DCHECK(task_runner_->BelongsToCurrentThread());
+ // When demuxer has finished the init segment, it should call ReportMetadata
+ // in case meeting 'decode' error when passing media segment but
+ // WebMediaPlayer's ready_state_ is still ReadyStateHaveNothing. In that case
+ // it will be treated as NetworkStateFormatError not NetworkStateDecodeError.
+ if (state_ == kInitDemuxer && status == PIPELINE_OK) {
DaleCurtis 2014/11/19 00:20:29 Why here instead of in StateTransitionTask before
+ ReportMetadata();
philipj_slow 2014/11/18 09:24:23 Will this affect both MSE and normal playback? The
+ start_timestamp_ = demuxer_->GetStartTime();
+ }
// Force post to process state transitions after current execution frame.
task_runner_->PostTask(
FROM_HERE,
@@ -339,13 +346,6 @@ void Pipeline::StateTransitionTask(PipelineStatus status) {
return InitializeRenderer(base::Bind(done_cb, PIPELINE_OK));
case kPlaying:
- // Report metadata the first time we enter the playing state.
- if (!is_initialized_) {
- is_initialized_ = true;
- ReportMetadata();
- start_timestamp_ = demuxer_->GetStartTime();
- }
-
base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
DCHECK(start_timestamp_ >= base::TimeDelta());
@@ -710,7 +710,7 @@ void Pipeline::ReportMetadata() {
metadata.natural_size = stream->video_decoder_config().natural_size();
metadata.video_rotation = stream->video_rotation();
}
- metadata_cb_.Run(metadata);
+ base::ResetAndReturn(&metadata_cb_).Run(metadata);
}
void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) {
« no previous file with comments | « media/base/pipeline.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698