Bug 1203836 - Properly handle silent chunks in AudioNodeExternalInputStream. r=karlt, a=lizzard
authorPaul Adenot <paul@paul.cx>
Mon, 21 Sep 2015 10:14:59 +0200
changeset 297900 d64d54d04a6b0f83a98a6101a59074054bf851c8
parent 297899 c55a615814341cd023034f52f8b6f761d677ccfe
child 297901 33718e845d0d19c5d9a0a8e4feee686079e022f8
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, lizzard
bugs1203836
milestone43.0a2
Bug 1203836 - Properly handle silent chunks in AudioNodeExternalInputStream. r=karlt, a=lizzard
dom/media/webaudio/AudioNodeExternalInputStream.cpp
--- a/dom/media/webaudio/AudioNodeExternalInputStream.cpp
+++ b/dom/media/webaudio/AudioNodeExternalInputStream.cpp
@@ -104,18 +104,22 @@ static void ConvertSegmentToAudioBlock(A
       case AUDIO_FORMAT_S16: {
         CopyChunkToBlock<int16_t>(*ci, aBlock, duration);
         break;
       }
       case AUDIO_FORMAT_FLOAT32: {
         CopyChunkToBlock<float>(*ci, aBlock, duration);
         break;
       }
-      case AUDIO_FORMAT_SILENCE:
+      case AUDIO_FORMAT_SILENCE: {
+        // The actual type of the sample does not matter here, but we still need
+        // to send some audio to the graph.
+        CopyChunkToBlock<float>(*ci, aBlock, duration);
         break;
+      }
     }
     duration += ci->GetDuration();
   }
 }
 
 void
 AudioNodeExternalInputStream::ProcessInput(GraphTime aFrom, GraphTime aTo,
                                            uint32_t aFlags)