| Index: content/renderer/media/webmediasource_impl.cc
|
| diff --git a/content/renderer/media/webmediasource_impl.cc b/content/renderer/media/webmediasource_impl.cc
|
| index b3078f7edcd5261de65bf4d5b91938478d028f1b..d6f708b50cd879fde9ae42332877179bbe5aa579 100644
|
| --- a/content/renderer/media/webmediasource_impl.cc
|
| +++ b/content/renderer/media/webmediasource_impl.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "content/renderer/media/webmediasource_impl.h"
|
|
|
| +#include "base/bind.h"
|
| #include "base/guid.h"
|
| #include "content/renderer/media/websourcebuffer_impl.h"
|
| #include "media/filters/chunk_demuxer.h"
|
| @@ -42,12 +43,20 @@ WebMediaSource::AddStatus WebMediaSourceImpl::addSourceBuffer(
|
| for (size_t i = 0; i < codecs.size(); ++i)
|
| new_codecs[i] = codecs[i].utf8().data();
|
|
|
| + scoped_ptr<WebSourceBufferImpl> web_source_buffer(
|
| + new WebSourceBufferImpl(id, demuxer_));
|
| +
|
| WebMediaSource::AddStatus result =
|
| static_cast<WebMediaSource::AddStatus>(
|
| - demuxer_->AddId(id, type.utf8().data(), new_codecs));
|
| + demuxer_->AddId(
|
| + id,
|
| + type.utf8().data(),
|
| + new_codecs,
|
| + base::Bind(&WebSourceBufferImpl::OnNewInitSegment,
|
| + base::Unretained(web_source_buffer.get()))));
|
|
|
| if (result == WebMediaSource::AddStatusOk)
|
| - *source_buffer = new WebSourceBufferImpl(id, demuxer_);
|
| + *source_buffer = web_source_buffer.release();
|
|
|
| return result;
|
| }
|
|
|