summaryrefslogtreecommitdiff
path: root/dom/media/MediaDecoder.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-06-07 16:04:56 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-06-07 16:04:56 +0200
commitd7beb75aa889967780067ade8219b4a662f22e38 (patch)
tree05714e8825122be0cd5a7d5e185b40bd967ae2a2 /dom/media/MediaDecoder.cpp
parent271f1ef600c06a74471665a040c9473d9f7a9a36 (diff)
downloaduxp-d7beb75aa889967780067ade8219b4a662f22e38.tar.gz
Media: harden TrackID handling.
Diffstat (limited to 'dom/media/MediaDecoder.cpp')
-rw-r--r--dom/media/MediaDecoder.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp
index ab39886ba7..9334d1bcb9 100644
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -327,11 +327,13 @@ MediaDecoder::SetVolume(double aVolume)
void
MediaDecoder::AddOutputStream(ProcessedMediaStream* aStream,
+ TrackID aNextAvailableTrackID,
bool aFinishWhenEnded)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mDecoderStateMachine, "Must be called after Load().");
- mDecoderStateMachine->AddOutputStream(aStream, aFinishWhenEnded);
+ mDecoderStateMachine->AddOutputStream(
+ aStream, aNextAvailableTrackID, aFinishWhenEnded);
}
void
@@ -342,6 +344,14 @@ MediaDecoder::RemoveOutputStream(MediaStream* aStream)
mDecoderStateMachine->RemoveOutputStream(aStream);
}
+TrackID
+MediaDecoder::NextAvailableTrackIDFor(MediaStream* aOutputStream) const
+{
+ MOZ_ASSERT(NS_IsMainThread());
+ MOZ_ASSERT(mDecoderStateMachine, "Must be called after Load().");
+ return mDecoderStateMachine->NextAvailableTrackIDFor(aOutputStream);
+}
+
double
MediaDecoder::GetDuration()
{
@@ -1736,6 +1746,8 @@ MediaDecoder::RemoveMediaTracks()
videoList->RemoveTracks();
}
+ element->EndPreCreatedCapturedDecoderTracks();
+
mMediaTracksConstructed = false;
}