Bug 1355933: P2. Make arguments const. r?kamidphish
MozReview-Commit-ID: AwtpgSJQFE0
--- a/dom/media/ADTSDemuxer.cpp
+++ b/dom/media/ADTSDemuxer.cpp
@@ -154,21 +154,22 @@ public:
// Resets the frame header and data.
void Reset()
{
mHeader.Reset();
mOffset = 0;
}
// Returns whether the valid
- bool Parse(int64_t aOffset, uint8_t* aStart, uint8_t* aEnd) {
+ bool Parse(int64_t aOffset, const uint8_t* aStart, const uint8_t* aEnd)
+ {
MOZ_ASSERT(aStart && aEnd);
bool found = false;
- uint8_t* ptr = aStart;
+ const uint8_t* ptr = aStart;
// Require at least 7 bytes of data at the end of the buffer for the minimum
// ADTS frame header.
while (ptr < aEnd - 7 && !found) {
found = mHeader.Parse(ptr);
ptr++;
}
mOffset = aOffset + (ptr - aStart) - 1;
@@ -211,17 +212,17 @@ public:
{
mFrame.Reset();
}
// Parses contents of given ByteReader for a valid frame header and returns
// true if one was found. After returning, the variable passed to
// 'aBytesToSkip' holds the amount of bytes to be skipped (if any) in order to
// jump across a large ID3v2 tag spanning multiple buffers.
- bool Parse(int64_t aOffset, uint8_t* aStart, uint8_t* aEnd)
+ bool Parse(int64_t aOffset, const uint8_t* aStart, const uint8_t* aEnd)
{
const bool found = mFrame.Parse(aOffset, aStart, aEnd);
if (mFrame.Length() && !mFirstFrame.Length()) {
mFirstFrame = mFrame;
}
return found;