diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-07 16:04:56 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-07 16:04:56 +0200 |
commit | d7beb75aa889967780067ade8219b4a662f22e38 (patch) | |
tree | 05714e8825122be0cd5a7d5e185b40bd967ae2a2 /dom/media/mediasink/DecodedStream.cpp | |
parent | 271f1ef600c06a74471665a040c9473d9f7a9a36 (diff) | |
download | UXP-d7beb75aa889967780067ade8219b4a662f22e38.tar UXP-d7beb75aa889967780067ade8219b4a662f22e38.tar.gz UXP-d7beb75aa889967780067ade8219b4a662f22e38.tar.lz UXP-d7beb75aa889967780067ade8219b4a662f22e38.tar.xz UXP-d7beb75aa889967780067ade8219b4a662f22e38.zip |
Media: harden TrackID handling.
Diffstat (limited to 'dom/media/mediasink/DecodedStream.cpp')
-rw-r--r-- | dom/media/mediasink/DecodedStream.cpp | 11 |
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() |