Skip to content

Commit

Permalink
Bug 1771011 - part10 : prevent adding a redundant refcount which caus…
Browse files Browse the repository at this point in the history
…es leaking streams. r=jolin

Depends on D152838

Differential Revision: https://phabricator.services.mozilla.com/D152842
  • Loading branch information
alastor0325 committed Aug 13, 2022
1 parent c0dfa53 commit f523b43
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dom/media/platforms/wmf/MFMediaSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ HRESULT MFMediaSource::RuntimeClassInitialize(const Maybe<AudioInfo>& aAudio,
mTaskQueue = TaskQueue::Create(
GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER), "MFMediaSource");
if (aAudio) {
mAudioStream = MFMediaEngineAudioStream::Create(streamId++, *aAudio, this);
mAudioStream.Attach(
MFMediaEngineAudioStream::Create(streamId++, *aAudio, this));
if (!mAudioStream) {
NS_WARNING("Failed to create audio stream");
return E_FAIL;
Expand All @@ -47,8 +48,8 @@ HRESULT MFMediaSource::RuntimeClassInitialize(const Maybe<AudioInfo>& aAudio,
// output implementation. Our first step is to make audio playback work.
if (StaticPrefs::media_wmf_media_engine_video_output_enabled()) {
if (aVideo) {
mVideoStream =
MFMediaEngineVideoStream::Create(streamId++, *aVideo, this);
mVideoStream.Attach(
MFMediaEngineVideoStream::Create(streamId++, *aVideo, this));
if (!mVideoStream) {
NS_WARNING("Failed to create video stream");
return E_FAIL;
Expand Down

0 comments on commit f523b43

Please sign in to comment.