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

Side by Side Diff: media/base/pipeline.cc

Issue 10831214: Fix Pipeline to properly handle errors during initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/pipeline_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 void Pipeline::InitializeTask(PipelineStatus last_stage_status) { 614 void Pipeline::InitializeTask(PipelineStatus last_stage_status) {
615 DCHECK(message_loop_->BelongsToCurrentThread()); 615 DCHECK(message_loop_->BelongsToCurrentThread());
616 616
617 if (last_stage_status != PIPELINE_OK) { 617 if (last_stage_status != PIPELINE_OK) {
618 // Currently only VideoDecoders have a recoverable error code. 618 // Currently only VideoDecoders have a recoverable error code.
619 if (state_ == kInitVideoDecoder && 619 if (state_ == kInitVideoDecoder &&
620 last_stage_status == DECODER_ERROR_NOT_SUPPORTED) { 620 last_stage_status == DECODER_ERROR_NOT_SUPPORTED) {
621 state_ = kInitAudioRenderer; 621 state_ = kInitAudioRenderer;
622 } else { 622 } else {
623 SetError(last_stage_status); 623 SetError(last_stage_status);
624 return;
624 } 625 }
625 } 626 }
626 627
627 // If we have received the stop or error signal, return immediately. 628 // If we have received the stop or error signal, return immediately.
628 if (IsPipelineStopPending() || IsPipelineStopped() || !IsPipelineOk()) 629 if (IsPipelineStopPending() || IsPipelineStopped() || !IsPipelineOk())
629 return; 630 return;
630 631
631 DCHECK(state_ == kInitDemuxer || 632 DCHECK(state_ == kInitDemuxer ||
632 state_ == kInitAudioDecoder || 633 state_ == kInitAudioDecoder ||
633 state_ == kInitAudioRenderer || 634 state_ == kInitAudioRenderer ||
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { 1277 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
1277 lock_.AssertAcquired(); 1278 lock_.AssertAcquired();
1278 if (!waiting_for_clock_update_) 1279 if (!waiting_for_clock_update_)
1279 return; 1280 return;
1280 1281
1281 waiting_for_clock_update_ = false; 1282 waiting_for_clock_update_ = false;
1282 clock_->Play(); 1283 clock_->Play();
1283 } 1284 }
1284 1285
1285 } // namespace media 1286 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698