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

Unified Diff: media/blink/webmediaplayer_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, 10 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
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 408569c7560234a179ccfed3ed0b766ce0bf3aaf..973d252383396b6ee5d71faa18e9e8acaae80fa6 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -187,7 +187,8 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
volume_(1.0),
volume_multiplier_(1.0),
renderer_factory_(std::move(renderer_factory)),
- surface_manager_(params.surface_manager()) {
+ surface_manager_(params.surface_manager()),
+ suppress_destruction_errors_(false) {
DCHECK(!adjust_allocated_memory_cb_.is_null());
DCHECK(renderer_factory_);
@@ -224,6 +225,7 @@ WebMediaPlayerImpl::~WebMediaPlayerImpl() {
}
// Abort any pending IO so stopping the pipeline doesn't get blocked.
+ suppress_destruction_errors_ = true;
if (data_source_)
data_source_->Abort();
if (chunk_demuxer_) {
@@ -978,6 +980,11 @@ void WebMediaPlayerImpl::OnPipelineError(PipelineStatus error) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
DCHECK_NE(error, PIPELINE_OK);
+ if (suppress_destruction_errors_)
+ return;
+
+ media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error));
+
if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) {
// Any error that occurs before reaching ReadyStateHaveMetadata should
// be considered a format error.
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698