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

--HG--
extra : rebase_source : 6de274d0cb76e4eaa39846285dd981c8ba34271b
extra : source : 3eb785084ec7268f3ddee2da3dc78646086bc749
This commit is contained in:
Andreas Pehrson 2016-04-15 15:52:59 +02:00
parent a2b7874858
commit ca31cde16e

View File

@ -2667,6 +2667,7 @@ SourceMediaStream::AddTrackInternal(TrackID aID, TrackRate aRate, StreamTime aSt
data->mEndOfFlushedData = aStart;
data->mCommands = TRACK_CREATE;
data->mData = aSegment;
ResampleAudioToGraphSampleRate(data, aSegment);
if (!(aFlags & ADDTRACK_QUEUED) && GraphImpl()) {
GraphImpl()->EnsureNextIteration();
}