bug 1207003 coallesce external output chunks when silent r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 09 Sep 2015 20:07:19 +1200
changeset 263982 b6ef4e4af23ad722085ea78d29c316d11efaa517
parent 263981 ccec05c4554b071a66731502a2a1ba9766564594
child 263983 ade3b46614b0a8b3f96ab8440c0bcbf497e9edd4
push id29423
push userkwierso@gmail.com
push dateWed, 23 Sep 2015 20:13:47 +0000
treeherdermozilla-central@bcbfa80a0dc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1207003
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1207003 coallesce external output chunks when silent r=padenot AppendAndConsumeChunk() will always append a new chunk, but AppendNullData() will use an existing null chunk if possible.
dom/media/webaudio/AudioNodeStream.cpp
--- a/dom/media/webaudio/AudioNodeStream.cpp
+++ b/dom/media/webaudio/AudioNodeStream.cpp
@@ -599,17 +599,17 @@ void
 AudioNodeStream::AdvanceOutputSegment()
 {
   StreamBuffer::Track* track = EnsureTrack(AUDIO_TRACK);
   // No more tracks will be coming
   mBuffer.AdvanceKnownTracksTime(STREAM_TIME_MAX);
 
   AudioSegment* segment = track->Get<AudioSegment>();
 
-  if (mFlags & EXTERNAL_OUTPUT) {
+  if (mFlags & EXTERNAL_OUTPUT && !mLastChunks[0].IsNull()) {
     segment->AppendAndConsumeChunk(mLastChunks[0].AsMutableChunk());
   } else {
     segment->AppendNullData(mLastChunks[0].GetDuration());
   }
 
   for (uint32_t j = 0; j < mListeners.Length(); ++j) {
     MediaStreamListener* l = mListeners[j];
     AudioChunk copyChunk = mLastChunks[0].AsAudioChunk();