Bug 957691 - Restore assertions. r?karlt
MozReview-Commit-ID: 1guHCRCzQjS
--- a/dom/media/MediaSegment.h
+++ b/dom/media/MediaSegment.h
@@ -411,17 +411,17 @@ protected:
}
mChunks.AppendElements(Move(aSource->mChunks));
}
void AppendSliceInternal(const MediaSegmentBase<C, Chunk>& aSource,
StreamTime aStart, StreamTime aEnd)
{
MOZ_ASSERT(aStart <= aEnd, "Endpoints inverted");
- NS_WARN_IF_FALSE(aStart >= 0 && aEnd <= aSource.mDuration, "Slice out of range");
+ NS_ASSERTION(aStart >= 0 && aEnd <= aSource.mDuration, "Slice out of range");
mDuration += aEnd - aStart;
StreamTime offset = 0;
for (uint32_t i = 0; i < aSource.mChunks.Length() && offset < aEnd; ++i) {
const Chunk& c = aSource.mChunks[i];
StreamTime start = std::max(aStart, offset);
StreamTime nextOffset = offset + c.GetDuration();
StreamTime end = std::min(aEnd, nextOffset);
if (start < end) {
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1434,19 +1434,19 @@ MediaStreamGraphImpl::Process()
#endif
// Since an AudioNodeStream is present, go ahead and
// produce audio block by block for all the rest of the streams.
ProduceDataForStreamsBlockByBlock(i, n->SampleRate());
doneAllProducing = true;
} else {
ps->ProcessInput(mProcessedTime, mStateComputedTime,
ProcessedMediaStream::ALLOW_FINISH);
- NS_WARN_IF_FALSE(stream->mTracks.GetEnd() >=
- GraphTimeToStreamTimeWithBlocking(stream, mStateComputedTime),
- "Stream did not produce enough data");
+ NS_ASSERTION(stream->mTracks.GetEnd() >=
+ GraphTimeToStreamTimeWithBlocking(stream, mStateComputedTime),
+ "Stream did not produce enough data");
}
}
}
NotifyHasCurrentData(stream);
// Only playback audio and video in real-time mode
if (mRealtime) {
CreateOrDestroyAudioStreams(stream);
if (CurrentDriver()->AsAudioCallbackDriver()) {
--- a/dom/media/StreamTracks.h
+++ b/dom/media/StreamTracks.h
@@ -26,17 +26,17 @@ inline bool IsTrackIDExplicit(const Trac
}
inline TrackTicks RateConvertTicksRoundDown(TrackRate aOutRate,
TrackRate aInRate,
TrackTicks aTicks)
{
NS_ASSERTION(0 < aOutRate && aOutRate <= TRACK_RATE_MAX, "Bad out rate");
NS_ASSERTION(0 < aInRate && aInRate <= TRACK_RATE_MAX, "Bad in rate");
- NS_WARN_IF_FALSE(0 <= aTicks && aTicks <= TRACK_TICKS_MAX, "Bad ticks"); // bug 957691
+ NS_ASSERTION(0 <= aTicks && aTicks <= TRACK_TICKS_MAX, "Bad ticks");
return (aTicks * aOutRate) / aInRate;
}
inline TrackTicks RateConvertTicksRoundUp(TrackRate aOutRate,
TrackRate aInRate, TrackTicks aTicks)
{
NS_ASSERTION(0 < aOutRate && aOutRate <= TRACK_RATE_MAX, "Bad out rate");
NS_ASSERTION(0 < aInRate && aInRate <= TRACK_RATE_MAX, "Bad in rate");
NS_ASSERTION(0 <= aTicks && aTicks <= TRACK_TICKS_MAX, "Bad ticks");