summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPale Moon <git-repo@palemoon.org>2018-04-20 06:49:45 +0200
committerPale Moon <git-repo@palemoon.org>2018-04-20 06:49:45 +0200
commit679016c0c65c17d0b863d34e68c9218a6d35afe7 (patch)
treeca63282c6526f3cd4e5353336f3ed44f1d408d0e
parent740366e5192159f46b436ab3772f54877a27b381 (diff)
downloadpalemoon-gre-679016c0c65c17d0b863d34e68c9218a6d35afe7.tar.gz
Revert "Work around crashes when trackless mediastreams are encountered."
This reverts commit 94dc8833c2abb9148c8ae4f1dc5026e0a201fdb6.
-rw-r--r--dom/media/MediaStreamGraph.cpp17
-rw-r--r--dom/media/TrackUnionStream.cpp3
2 files changed, 6 insertions, 14 deletions
diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp
index 5d1dcbb4c..6fe550c35 100644
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -195,14 +195,12 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
SourceMediaStream::TrackData* data = &aStream->mUpdateTracks[i];
aStream->ApplyTrackDisabling(data->mID, data->mData);
for (MediaStreamListener* l : aStream->mListeners) {
- StreamBuffer::Track* track = aStream->mBuffer.FindTrack(data->mID);
- StreamTime offset = ((data->mCommands & SourceMediaStream::TRACK_CREATE) || !track)
- ? data->mStart : track->GetSegment()->GetDuration();
+ StreamTime offset = (data->mCommands & SourceMediaStream::TRACK_CREATE)
+ ? data->mStart : aStream->mBuffer.FindTrack(data->mID)->GetSegment()->GetDuration();
l->NotifyQueuedTrackChanges(this, data->mID,
offset, data->mCommands, *data->mData);
}
- StreamBuffer::Track* track = aStream->mBuffer.FindTrack(data->mID);
- if ((data->mCommands & SourceMediaStream::TRACK_CREATE) || !track) {
+ if (data->mCommands & SourceMediaStream::TRACK_CREATE) {
MediaSegment* segment = data->mData.forget();
STREAM_LOG(PR_LOG_DEBUG, ("SourceMediaStream %p creating track %d, start %lld, initial end %lld",
aStream, data->mID, int64_t(data->mStart),
@@ -216,7 +214,7 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
data->mCommands &= ~SourceMediaStream::TRACK_CREATE;
notifiedTrackCreated = true;
} else if (data->mData->GetDuration() > 0) {
- MediaSegment* dest = track->GetSegment();
+ MediaSegment* dest = aStream->mBuffer.FindTrack(data->mID)->GetSegment();
STREAM_LOG(PR_LOG_DEBUG+1, ("SourceMediaStream %p track %d, advancing end from %lld to %lld",
aStream, data->mID,
int64_t(dest->GetDuration()),
@@ -224,8 +222,8 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
data->mEndOfFlushedData += data->mData->GetDuration();
dest->AppendFrom(data->mData);
}
- if ((data->mCommands & SourceMediaStream::TRACK_END) && track) {
- track->SetEnded();
+ if (data->mCommands & SourceMediaStream::TRACK_END) {
+ aStream->mBuffer.FindTrack(data->mID)->SetEnded();
aStream->mUpdateTracks.RemoveElementAt(i);
}
}
@@ -269,9 +267,6 @@ MediaStreamGraphImpl::UpdateBufferSufficiencyState(SourceMediaStream* aStream)
continue;
}
StreamBuffer::Track* track = aStream->mBuffer.FindTrack(data->mID);
- if (!track) {
- continue;
- }
// Note that track->IsEnded() must be false, otherwise we would have
// removed the track from mUpdateTracks already.
NS_ASSERTION(!track->IsEnded(), "What is this track doing here?");
diff --git a/dom/media/TrackUnionStream.cpp b/dom/media/TrackUnionStream.cpp
index 3740ea5db..52f681187 100644
--- a/dom/media/TrackUnionStream.cpp
+++ b/dom/media/TrackUnionStream.cpp
@@ -250,9 +250,6 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
TrackMapEntry* map = &mTrackMap[aMapIndex];
StreamBuffer::Track* outputTrack = mBuffer.FindTrack(map->mOutputTrackID);
MOZ_ASSERT(outputTrack && !outputTrack->IsEnded(), "Can't copy to ended track");
- if (!outputTrack) {
- return;
- }
MediaSegment* segment = map->mSegment;
MediaStream* source = map->mInputPort->GetSource();