mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-10 13:54:27 +00:00
Bug 1332845 - Remove direct listeners before ending track in TrackUnionStream. r=jesup
There was a race where ending the track before removing the direct listener here, allowed the source to append more data (notifying the direct listener) after the consumer had been notified of the ending track. MozReview-Commit-ID: E08UeMNQhGx --HG-- extra : rebase_source : 740c4fde40b9e19974922cd893618032c683493d
This commit is contained in:
parent
5835686871
commit
9c513ae0c5
@ -57,13 +57,13 @@ TrackUnionStream::TrackUnionStream(AbstractThread* aMainThread) :
|
||||
for (int32_t i = mTrackMap.Length() - 1; i >= 0; --i) {
|
||||
if (mTrackMap[i].mInputPort == aPort) {
|
||||
STREAM_LOG(LogLevel::Debug, ("TrackUnionStream %p removing trackmap entry %d", this, i));
|
||||
EndTrack(i);
|
||||
nsTArray<RefPtr<DirectMediaStreamTrackListener>> listeners(
|
||||
mTrackMap[i].mOwnedDirectListeners);
|
||||
for (auto listener : listeners) {
|
||||
// Remove listeners while the entry still exists.
|
||||
RemoveDirectTrackListenerImpl(listener, mTrackMap[i].mOutputTrackID);
|
||||
}
|
||||
EndTrack(i);
|
||||
mTrackMap.RemoveElementAt(i);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user