summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasink/DecodedStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/mediasink/DecodedStream.cpp')
-rw-r--r--dom/media/mediasink/DecodedStream.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/dom/media/mediasink/DecodedStream.cpp b/dom/media/mediasink/DecodedStream.cpp
index 9501a6cde..00bc5ea49 100644
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -181,17 +181,22 @@ DecodedStreamData::DecodedStreamData(OutputStreamManager* aOutputStreamManager,
, mOutputStreamManager(aOutputStreamManager)
{
mStream->AddListener(mListener);
- mOutputStreamManager->Connect(mStream);
+ TrackID audioTrack = TRACK_NONE;
+ TrackID videoTrack = TRACK_NONE;
// Initialize tracks.
if (aInit.mInfo.HasAudio()) {
- mStream->AddAudioTrack(aInit.mInfo.mAudio.mTrackId,
+ audioTrack = aInit.mInfo.mAudio.mTrackId;
+ mStream->AddAudioTrack(audioTrack,
aInit.mInfo.mAudio.mRate,
0, new AudioSegment());
}
if (aInit.mInfo.HasVideo()) {
- mStream->AddTrack(aInit.mInfo.mVideo.mTrackId, 0, new VideoSegment());
+ videoTrack = aInit.mInfo.mVideo.mTrackId;
+ mStream->AddTrack(videoTrack, 0, new VideoSegment());
}
+
+ mOutputStreamManager->Connect(mStream, audioTrack, videoTrack);
}
DecodedStreamData::~DecodedStreamData()