Bug 1408294 - Append null audio data when audio input underruns. r=padenot

MozReview-Commit-ID: KEP3J41BEmJ

--HG--
extra : rebase_source : f8b5fb4e331e29f28e1d421b145201e811e20f7b
This commit is contained in:
Andreas Pehrson 2017-12-21 19:01:17 +01:00
parent c16103af60
commit 87f1066788
2 changed files with 13 additions and 1 deletions

View File

@ -553,8 +553,19 @@ MediaEngineWebRTCMicrophoneSource::NotifyPull(MediaStreamGraph *aGraph,
StreamTime aDesiredTime,
const PrincipalHandle& aPrincipalHandle)
{
// Ignore - we push audio data
LOG_FRAMES(("NotifyPull, desired = %" PRId64, (int64_t) aDesiredTime));
StreamTime delta = aDesiredTime - aSource->GetEndOfAppendedData(aID);
if (delta <= 0) {
return;
}
// Not enough data has been pushed so we fill it with silence.
// This could be due to underruns or because we have been stopped.
AudioSegment audio;
audio.AppendNullData(delta);
aSource->AppendToTrack(aID, &audio);
}
void

View File

@ -40,6 +40,7 @@ if CONFIG['MOZ_WEBRTC']:
LOCAL_INCLUDES += [
'..',
'/dom/base',
'/dom/media',
'/media/libyuv/libyuv/include',
'/media/webrtc/signaling/src/common',
'/media/webrtc/signaling/src/common/browser_logging',