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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 605013002: Refactor MediaSourceDelegate destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mp4_stream_parser_hack
Patch Set: comments addressed Created 6 years, 3 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 | « content/renderer/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index ea6ba1f0d538dcbb96d046e39c9af674aca353da..155eea86d912b4783858385ae90d1a8b95bb0d3f 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -210,6 +210,16 @@ WebMediaPlayerAndroid::~WebMediaPlayerAndroid() {
delegate_->PlayerGone(this);
stream_texture_factory_->RemoveObserver(this);
+
+ if (media_source_delegate_) {
+ // Part of |media_source_delegate_| needs to be stopped on the media thread.
+ // Wait until |media_source_delegate_| is fully stopped before tearing
+ // down other objects.
+ base::WaitableEvent waiter(false, false);
+ media_source_delegate_->Stop(
+ base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter)));
+ waiter.Wait();
+ }
}
void WebMediaPlayerAndroid::load(LoadType load_type,
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698