bug 1172979 permit retrieving const channel data from const AudioChunk r?padenot
MozReview-Commit-ID: 8mP49nONMYI
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -216,20 +216,20 @@ struct AudioChunk {
}
// Memory in the array is owned by mBuffer.
amount += mChannelData.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}
template<typename T>
- const nsTArray<const T*>& ChannelData()
+ const nsTArray<const T*>& ChannelData() const
{
MOZ_ASSERT(AudioSampleTypeToFormat<T>::Format == mBufferFormat);
- return *reinterpret_cast<nsTArray<const T*>*>(&mChannelData);
+ return *reinterpret_cast<const nsTArray<const T*>*>(&mChannelData);
}
PrincipalHandle GetPrincipalHandle() const { return mPrincipalHandle; }
StreamTime mDuration; // in frames within the buffer
RefPtr<ThreadSharedObject> mBuffer; // the buffer object whose lifetime is managed; null means data is all zeroes
nsTArray<const void*> mChannelData; // one pointer per channel; empty if and only if mBuffer is null
float mVolume; // volume multiplier to apply (1.0f if mBuffer is nonnull)