зеркало из https://github.com/mozilla/gecko-dev.git
bug 1391482 permit AudioChunk channel data initialization when mBuffer is not shared r=padenot
MozReview-Commit-ID: AZ30fTVHHce --HG-- extra : rebase_source : 313f0e643c9fce3500fe4c238929c4636560834e
This commit is contained in:
Родитель
9a6e4c2741
Коммит
d17ceb8a8f
|
@ -233,6 +233,18 @@ struct AudioChunk {
|
|||
(&mChannelData);
|
||||
}
|
||||
|
||||
/**
|
||||
* ChannelFloatsForWrite() should be used only when mBuffer is owned solely
|
||||
* by the calling thread.
|
||||
*/
|
||||
template<typename T>
|
||||
T* ChannelDataForWrite(size_t aChannel)
|
||||
{
|
||||
MOZ_ASSERT(AudioSampleTypeToFormat<T>::Format == mBufferFormat);
|
||||
MOZ_ASSERT(!mBuffer->IsShared());
|
||||
return static_cast<T*>(const_cast<void*>(mChannelData[aChannel]));
|
||||
}
|
||||
|
||||
PrincipalHandle GetPrincipalHandle() const { return mPrincipalHandle; }
|
||||
|
||||
StreamTime mDuration; // in frames within the buffer
|
||||
|
|
Загрузка…
Ссылка в новой задаче