Index: chromecast/media/cma/pipeline/media_pipeline_impl.cc |
diff --git a/chromecast/media/cma/pipeline/media_pipeline_impl.cc b/chromecast/media/cma/pipeline/media_pipeline_impl.cc |
index c9d0e288c76479a9604ef9e5c689fe7a440fe2c3..2c644f1a03015e37ccc5c90a2308bb31439be4a8 100644 |
--- a/chromecast/media/cma/pipeline/media_pipeline_impl.cc |
+++ b/chromecast/media/cma/pipeline/media_pipeline_impl.cc |
@@ -66,6 +66,15 @@ MediaPipelineImpl::MediaPipelineImpl() |
MediaPipelineImpl::~MediaPipelineImpl() { |
CMALOG(kLogControl) << __FUNCTION__; |
DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
+ weak_factory_.InvalidateWeakPtrs(); |
+ |
+ // Since av pipeline still need to access device components in their |
+ // destructor, it's important to delete them first. |
+ video_pipeline_.reset(); |
+ audio_pipeline_.reset(); |
+ media_pipeline_backend_.reset(); |
+ client_.device_components_destroy_cb.Run(); |
halliwell
2015/08/25 00:48:34
I think you have to check is_null before calling?
yucliu1
2015/08/25 00:53:11
The SetClient requires that all the callbacks can
halliwell
2015/08/25 01:02:49
You didn't add DCHECKs to SetClient for these new
yucliu1
2015/08/25 04:27:58
Done.
|
} |
void MediaPipelineImpl::Initialize( |
@@ -75,6 +84,7 @@ void MediaPipelineImpl::Initialize( |
DCHECK(thread_checker_.CalledOnValidThread()); |
media_pipeline_backend_.reset(media_pipeline_backend.release()); |
clock_device_ = media_pipeline_backend_->GetClock(); |
+ client_.device_components_create_cb.Run(); |
halliwell
2015/08/25 00:48:34
same here.
yucliu1
2015/08/25 04:27:58
Done.
|
if (load_type == kLoadTypeURL || load_type == kLoadTypeMediaSource) { |
base::TimeDelta low_threshold(kLowBufferThresholdURL); |