| Index: content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| index 68baaa85c845c91dda916e544ddd9e15e27431a3..61aa7dfc0b73ea03dbeea0fca2afad757e769142 100644
|
| --- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| @@ -160,7 +160,6 @@ V4L2VideoDecodeAccelerator::V4L2VideoDecodeAccelerator(
|
| const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy)
|
| : child_message_loop_proxy_(base::MessageLoopProxy::current()),
|
| io_message_loop_proxy_(io_message_loop_proxy),
|
| - weak_this_(base::AsWeakPtr(this)),
|
| io_client_(io_client),
|
| decoder_thread_("V4L2DecoderThread"),
|
| decoder_state_(kUninitialized),
|
| @@ -184,7 +183,10 @@ V4L2VideoDecodeAccelerator::V4L2VideoDecodeAccelerator(
|
| device_poll_thread_("V4L2DevicePollThread"),
|
| make_context_current_(make_context_current),
|
| egl_display_(egl_display),
|
| - video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN) {}
|
| + video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN),
|
| + weak_this_factory_(this) {
|
| + weak_this_ = weak_this_factory_.GetWeakPtr();
|
| +}
|
|
|
| V4L2VideoDecodeAccelerator::~V4L2VideoDecodeAccelerator() {
|
| DCHECK(!decoder_thread_.IsRunning());
|
| @@ -289,9 +291,6 @@ bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
|
| }
|
|
|
| SetDecoderState(kInitialized);
|
| -
|
| - child_message_loop_proxy_->PostTask(FROM_HERE, base::Bind(
|
| - &Client::NotifyInitializeDone, client_));
|
| return true;
|
| }
|
|
|
| @@ -428,6 +427,7 @@ void V4L2VideoDecodeAccelerator::Destroy() {
|
|
|
| // We're destroying; cancel all callbacks.
|
| client_ptr_factory_.reset();
|
| + weak_this_factory_.InvalidateWeakPtrs();
|
|
|
| // If the decoder thread is running, destroy using posted task.
|
| if (decoder_thread_.IsRunning()) {
|
|
|