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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 5362003: Stopgap fix for crash in issue 53867 comment 15 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 10 years, 1 month 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 | « webkit/glue/webmediaplayer_impl.h ('k') | webkit/support/webkit_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webmediaplayer_impl.cc
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index bbf6172ff394afe82449e7a1641fe2667f072646..58489cc95cbca1509595964ce77180a0ba43f26d 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -225,28 +225,32 @@ void WebMediaPlayerImpl::Proxy::PutCurrentFrame(
WebMediaPlayerImpl::WebMediaPlayerImpl(
WebKit::WebMediaPlayerClient* client,
- media::MediaFilterCollection* collection,
- MediaResourceLoaderBridgeFactory* bridge_factory_simple,
- MediaResourceLoaderBridgeFactory* bridge_factory_buffered,
- bool use_simple_data_source,
- scoped_refptr<WebVideoRenderer> web_video_renderer)
+ media::MediaFilterCollection* collection)
: network_state_(WebKit::WebMediaPlayer::Empty),
ready_state_(WebKit::WebMediaPlayer::HaveNothing),
main_loop_(NULL),
filter_collection_(collection),
+ pipeline_(NULL),
pipeline_thread_("PipelineThread"),
paused_(true),
playback_rate_(0.0f),
client_(client),
+ proxy_(NULL),
pipeline_stopped_(false, false) {
// Saves the current message loop.
DCHECK(!main_loop_);
main_loop_ = MessageLoop::current();
+}
+bool WebMediaPlayerImpl::Initialize(
+ MediaResourceLoaderBridgeFactory* bridge_factory_simple,
+ MediaResourceLoaderBridgeFactory* bridge_factory_buffered,
+ bool use_simple_data_source,
+ scoped_refptr<WebVideoRenderer> web_video_renderer) {
// Create the pipeline and its thread.
if (!pipeline_thread_.Start()) {
NOTREACHED() << "Could not start PipelineThread";
- return;
+ return false;
}
pipeline_ = new media::PipelineImpl(pipeline_thread_.message_loop());
@@ -290,6 +294,8 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
filter_collection_->AddAudioDecoder(new media::FFmpegAudioDecoder());
filter_collection_->AddVideoDecoder(new media::FFmpegVideoDecoder(NULL));
filter_collection_->AddAudioRenderer(new media::NullAudioRenderer());
+
+ return true;
}
WebMediaPlayerImpl::~WebMediaPlayerImpl() {
@@ -776,10 +782,12 @@ void WebMediaPlayerImpl::Destroy() {
// Make sure to kill the pipeline so there's no more media threads running.
// Note: stopping the pipeline might block for a long time.
- pipeline_->Stop(NewCallback(this,
- &WebMediaPlayerImpl::PipelineStoppedCallback));
- pipeline_stopped_.Wait();
- pipeline_thread_.Stop();
+ if (pipeline_) {
+ pipeline_->Stop(NewCallback(this,
+ &WebMediaPlayerImpl::PipelineStoppedCallback));
+ pipeline_stopped_.Wait();
+ pipeline_thread_.Stop();
+ }
// And then detach the proxy, it may live on the render thread for a little
// longer until all the tasks are finished.
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | webkit/support/webkit_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698