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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1819023002: Merge M50: "Supress pipeline errors during destruction and suspend." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: 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 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 1f8b3405a578c8228aa126b685effbc4492bcc89..5a2983035b4da72066d08d304c99f2df4506c5a5 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -186,7 +186,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_);
@@ -223,6 +224,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_) {
@@ -1002,6 +1004,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