mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1042672 - s/aSamples/aFrames/ in AudioOutputObserver::InsertFarEnd so it's consistent with the rest of the media code. r=jesup
In Gecko (and everywhere else, but sometimes not in the WebRTC code), a "frame" or "sample-frames" is the set of all sample that will play at the same time on all channels, whereas a "sample" is a single value on a specific channel.
This commit is contained in:
parent
02f16281e5
commit
27cb259315
@ -27,7 +27,7 @@ public:
|
||||
virtual ~AudioOutputObserver();
|
||||
|
||||
void Clear();
|
||||
void InsertFarEnd(const AudioDataValue *aBuffer, uint32_t aSamples, bool aOverran,
|
||||
void InsertFarEnd(const AudioDataValue *aBuffer, uint32_t aFrames, bool aOverran,
|
||||
int aFreq, int aChannels, AudioSampleFormat aFormat);
|
||||
uint32_t PlayoutFrequency() { return mPlayoutFreq; }
|
||||
uint32_t PlayoutChannels() { return mPlayoutChannels; }
|
||||
|
@ -92,7 +92,7 @@ AudioOutputObserver::Size()
|
||||
|
||||
// static
|
||||
void
|
||||
AudioOutputObserver::InsertFarEnd(const AudioDataValue *aBuffer, uint32_t aSamples, bool aOverran,
|
||||
AudioOutputObserver::InsertFarEnd(const AudioDataValue *aBuffer, uint32_t aFrames, bool aOverran,
|
||||
int aFreq, int aChannels, AudioSampleFormat aFormat)
|
||||
{
|
||||
if (mPlayoutChannels != 0) {
|
||||
@ -126,7 +126,7 @@ AudioOutputObserver::InsertFarEnd(const AudioDataValue *aBuffer, uint32_t aSampl
|
||||
// Rechunk to 10ms.
|
||||
// The AnalyzeReverseStream() and WebRtcAec_BufferFarend() functions insist on 10ms
|
||||
// samples per call. Annoying...
|
||||
while (aSamples) {
|
||||
while (aFrames) {
|
||||
if (!mSaved) {
|
||||
mSaved = (FarEndAudioChunk *) moz_xmalloc(sizeof(FarEndAudioChunk) +
|
||||
(mChunkSize * aChannels - 1)*sizeof(int16_t));
|
||||
@ -135,8 +135,8 @@ AudioOutputObserver::InsertFarEnd(const AudioDataValue *aBuffer, uint32_t aSampl
|
||||
aOverran = false;
|
||||
}
|
||||
uint32_t to_copy = mChunkSize - mSamplesSaved;
|
||||
if (to_copy > aSamples) {
|
||||
to_copy = aSamples;
|
||||
if (to_copy > aFrames) {
|
||||
to_copy = aFrames;
|
||||
}
|
||||
|
||||
int16_t *dest = &(mSaved->mData[mSamplesSaved * aChannels]);
|
||||
@ -147,7 +147,7 @@ AudioOutputObserver::InsertFarEnd(const AudioDataValue *aBuffer, uint32_t aSampl
|
||||
fwrite(&(mSaved->mData[mSamplesSaved * aChannels]), to_copy * aChannels, sizeof(int16_t), fp);
|
||||
}
|
||||
#endif
|
||||
aSamples -= to_copy;
|
||||
aFrames -= to_copy;
|
||||
mSamplesSaved += to_copy;
|
||||
aBuffer += to_copy * aChannels;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user