Bug 1246310 - Resample the AudioSegment in SourceMediaStream::AddAudioTrack. r=padenot
authorAndreas Pehrson <pehrsons@gmail.com>
Fri, 15 Apr 2016 15:52:59 +0200
changeset 331885 34d7c1009ea882388eb2b2cc62f6ac6dbbb3c9b1
parent 331884 cc01ccccdedcc384176c1fa3694d79d0e3213ac0
child 331886 da9b8b7a0263ce4ac6ca83b6fe225dc5ebf39692
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1246310
milestone48.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 1246310 - Resample the AudioSegment in SourceMediaStream::AddAudioTrack. r=padenot AddAudioTrack() has this comment: > * Like AddTrack, but resamples audio from aRate to the graph rate. Even so it would only resample the AudioSegments added through AppendToTrack. Not the initial one, provided to AddAudioTrack itself, even though MediaPipelineReceiveAudio depends on this functionality. MozReview-Commit-ID: BibF9ByjKq3
dom/media/MediaStreamGraph.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -2662,16 +2662,17 @@ SourceMediaStream::AddTrackInternal(Trac
   LIFECYCLE_LOG("AddTrackInternal: %lu/%lu", mPendingTracks.Length(), mUpdateTracks.Length());
   data->mID = aID;
   data->mInputRate = aRate;
   data->mResamplerChannelCount = 0;
   data->mStart = aStart;
   data->mEndOfFlushedData = aStart;
   data->mCommands = TRACK_CREATE;
   data->mData = aSegment;
+  ResampleAudioToGraphSampleRate(data, aSegment);
   if (!(aFlags & ADDTRACK_QUEUED) && GraphImpl()) {
     GraphImpl()->EnsureNextIteration();
   }
 }
 
 void
 SourceMediaStream::FinishAddTracks()
 {