Bug 1011149 - Video freezes when audio track is disabled on remote stream. r=jesup, a=sledru
authorRandy Lin <rlin@mozilla.com>
Tue, 10 Jun 2014 10:32:30 +0800
changeset 200589 b3480c1d1f6eb269c6b80646cdba3c9427aedf0e
parent 200588 26461e10e6d720ad9afa7d002aa70cd89b885262
child 200590 e64edb137dca260e46b08633b56fda64863f807f
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, sledru
bugs1011149
milestone31.0
Bug 1011149 - Video freezes when audio track is disabled on remote stream. r=jesup, a=sledru
content/media/AudioSegment.h
--- a/content/media/AudioSegment.h
+++ b/content/media/AudioSegment.h
@@ -180,17 +180,17 @@ public:
     mDuration = 0;
 
     for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) {
       nsAutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
       nsAutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
       AudioChunk& c = *ci;
       // If this chunk is null, don't bother resampling, just alter its duration
       if (c.IsNull()) {
-        c.mDuration *= aOutRate / aInRate;
+        c.mDuration = (c.mDuration * aOutRate) / aInRate;
         mDuration += c.mDuration;
         continue;
       }
       uint32_t channels = c.mChannelData.Length();
       output.SetLength(channels);
       bufferPtrs.SetLength(channels);
       uint32_t inFrames = c.mDuration;
       // Round up to allocate; the last frame may not be used.