diff --git a/content/media/MediaSegment.h b/content/media/MediaSegment.h index a3aca47e5098..ebe7e371f5ea 100644 --- a/content/media/MediaSegment.h +++ b/content/media/MediaSegment.h @@ -193,6 +193,19 @@ public: mDuration += aDuration; } + class ChunkIterator { + public: + ChunkIterator(MediaSegmentBase& aSegment) + : mSegment(aSegment), mIndex(0) {} + bool IsEnded() { return mIndex >= mSegment.mChunks.Length(); } + void Next() { ++mIndex; } + Chunk& operator*() { return mSegment.mChunks[mIndex]; } + Chunk* operator->() { return &mSegment.mChunks[mIndex]; } + private: + MediaSegmentBase& mSegment; + uint32_t mIndex; + }; + protected: MediaSegmentBase(Type aType) : MediaSegment(aType) {} @@ -269,19 +282,6 @@ protected: return &mChunks[mChunks.Length() - 1]; } - class ChunkIterator { - public: - ChunkIterator(MediaSegmentBase& aSegment) - : mSegment(aSegment), mIndex(0) {} - bool IsEnded() { return mIndex >= mSegment.mChunks.Length(); } - void Next() { ++mIndex; } - Chunk& operator*() { return mSegment.mChunks[mIndex]; } - Chunk* operator->() { return &mSegment.mChunks[mIndex]; } - private: - MediaSegmentBase& mSegment; - uint32_t mIndex; - }; - void RemoveLeading(TrackTicks aDuration, uint32_t aStartIndex) { NS_ASSERTION(aDuration >= 0, "Can't remove negative duration");