bug 1404220 remove explicit unit volume AudioChunk settings, which are now initialized at construction r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 06 Oct 2017 18:48:12 +1300
changeset 427896 981fab1b34e856e6755adbe6ffba8d6f3c961bac
parent 427895 fe8cc992cbc999222485f616f0e0274f406a0573
child 427897 6ffe631f903855c8537ad400b5ab22aad301ba9b
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewerspadenot
bugs1404220
milestone58.0a1
bug 1404220 remove explicit unit volume AudioChunk settings, which are now initialized at construction r=padenot MozReview-Commit-ID: EahkZtZAb18
dom/media/AudioCaptureStream.cpp
dom/media/AudioSegment.h
dom/media/webaudio/AudioBuffer.cpp
--- a/dom/media/AudioCaptureStream.cpp
+++ b/dom/media/AudioCaptureStream.cpp
@@ -155,17 +155,16 @@ AudioCaptureStream::MixerCallback(AudioD
     PodCopy(out, aMixedBuffer + written, aFrames);
     bufferPtrs[channel] = out;
     written += aFrames;
   }
   AudioChunk chunk;
   chunk.mBuffer = new mozilla::SharedChannelArrayBuffer<AudioDataValue>(&output);
   chunk.mDuration = aFrames;
   chunk.mBufferFormat = aFormat;
-  chunk.mVolume = 1.0f;
   chunk.mChannelData.SetLength(MONO);
   for (uint32_t channel = 0; channel < aChannels; channel++) {
     chunk.mChannelData[channel] = bufferPtrs[channel];
   }
 
   // Now we have mixed data, simply append it to out track.
   EnsureTrack(mTrackId)->Get<AudioSegment>()->AppendAndConsumeChunk(&chunk);
 }
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -338,33 +338,31 @@ public:
                     const nsTArray<const float*>& aChannelData,
                     int32_t aDuration, const PrincipalHandle& aPrincipalHandle)
   {
     AudioChunk* chunk = AppendChunk(aDuration);
     chunk->mBuffer = aBuffer;
     for (uint32_t channel = 0; channel < aChannelData.Length(); ++channel) {
       chunk->mChannelData.AppendElement(aChannelData[channel]);
     }
-    chunk->mVolume = 1.0f;
     chunk->mBufferFormat = AUDIO_FORMAT_FLOAT32;
 #ifdef MOZILLA_INTERNAL_API
     chunk->mTimeStamp = TimeStamp::Now();
 #endif
     chunk->mPrincipalHandle = aPrincipalHandle;
   }
   void AppendFrames(already_AddRefed<ThreadSharedObject> aBuffer,
                     const nsTArray<const int16_t*>& aChannelData,
                     int32_t aDuration, const PrincipalHandle& aPrincipalHandle)
   {
     AudioChunk* chunk = AppendChunk(aDuration);
     chunk->mBuffer = aBuffer;
     for (uint32_t channel = 0; channel < aChannelData.Length(); ++channel) {
       chunk->mChannelData.AppendElement(aChannelData[channel]);
     }
-    chunk->mVolume = 1.0f;
     chunk->mBufferFormat = AUDIO_FORMAT_S16;
 #ifdef MOZILLA_INTERNAL_API
     chunk->mTimeStamp = TimeStamp::Now();
 #endif
     chunk->mPrincipalHandle = aPrincipalHandle;
   }
   // Consumes aChunk, and returns a pointer to the persistent copy of aChunk
   // in the segment.
--- a/dom/media/webaudio/AudioBuffer.cpp
+++ b/dom/media/webaudio/AudioBuffer.cpp
@@ -217,17 +217,16 @@ AudioBuffer::SetSharedChannels(
 {
   RefPtr<ThreadSharedFloatArrayBufferList> buffer = aBuffer;
   uint32_t channelCount = buffer->GetChannels();
   mSharedChannels.mChannelData.SetLength(channelCount);
   for (uint32_t i = 0; i < channelCount; ++i) {
     mSharedChannels.mChannelData[i] = buffer->GetData(i);
   }
   mSharedChannels.mBuffer = buffer.forget();
-  mSharedChannels.mVolume = 1.0f;
   mSharedChannels.mBufferFormat = AUDIO_FORMAT_FLOAT32;
 }
 
 /* static */ already_AddRefed<AudioBuffer>
 AudioBuffer::Create(nsPIDOMWindowInner* aWindow, uint32_t aNumberOfChannels,
                     uint32_t aLength, float aSampleRate,
                     already_AddRefed<ThreadSharedFloatArrayBufferList>
                       aInitialContents,