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

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

Issue 1753043002: Supress pipeline errors during destruction and suspend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment style. Created 4 years, 9 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
« no previous file with comments | « media/base/demuxer.h ('k') | media/base/pipeline_impl_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_impl.h" 5 #include "media/base/pipeline_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 SetState(kStopping); 576 SetState(kStopping);
577 pending_callbacks_.reset(); 577 pending_callbacks_.reset();
578 DoStop( 578 DoStop(
579 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr())); 579 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr()));
580 } 580 }
581 581
582 void PipelineImpl::ErrorChangedTask(PipelineStatus error) { 582 void PipelineImpl::ErrorChangedTask(PipelineStatus error) {
583 DCHECK(task_runner_->BelongsToCurrentThread()); 583 DCHECK(task_runner_->BelongsToCurrentThread());
584 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!"; 584 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!";
585 585
586 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error)); 586 // Don't report pipeline error events to the media log here. The embedder will
587 // log this when |error_cb_| is called. If the pipeline is already stopped or
588 // stopping we also don't want to log any event. In case we are suspending or
589 // suspended, the error may be recoverable, so don't propagate it now, instead
590 // let the subsequent seek during resume propagate it if it's unrecoverable.
587 591
588 if (state_ == kStopping || state_ == kStopped) 592 if (state_ == kStopping || state_ == kStopped || state_ == kSuspending ||
593 state_ == kSuspended) {
589 return; 594 return;
595 }
590 596
591 SetState(kStopping); 597 SetState(kStopping);
592 pending_callbacks_.reset(); 598 pending_callbacks_.reset();
593 status_ = error; 599 status_ = error;
594 600
595 DoStop( 601 DoStop(
596 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr())); 602 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr()));
597 } 603 }
598 604
599 void PipelineImpl::PlaybackRateChangedTask(double playback_rate) { 605 void PipelineImpl::PlaybackRateChangedTask(double playback_rate) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 metadata_cb_.Run(metadata); 865 metadata_cb_.Run(metadata);
860 } 866 }
861 867
862 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) { 868 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) {
863 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 869 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
864 DCHECK(task_runner_->BelongsToCurrentThread()); 870 DCHECK(task_runner_->BelongsToCurrentThread());
865 buffering_state_cb_.Run(new_buffering_state); 871 buffering_state_cb_.Run(new_buffering_state);
866 } 872 }
867 873
868 } // namespace media 874 } // namespace media
OLDNEW
« no previous file with comments | « media/base/demuxer.h ('k') | media/base/pipeline_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698