diff --git a/dom/media/gtest/TestAudioInputProcessing.cpp b/dom/media/gtest/TestAudioInputProcessing.cpp index 8fcf6bacce32..ed5d14fcb84f 100644 --- a/dom/media/gtest/TestAudioInputProcessing.cpp +++ b/dom/media/gtest/TestAudioInputProcessing.cpp @@ -74,6 +74,7 @@ TEST(TestAudioInputProcessing, UnaccountedPacketizerBuffering) AudioInputProcessing::BufferInfo{ buffer.Elements(), nrFrames, channels, rate}, nextTime - nrFrames); + aip->ProcessInput(graph, nullptr); aip->Pull(graph, processedTime, nextTime, segment.GetDuration(), &segment, true, &ended); EXPECT_EQ(aip->NumBufferedFrames(graph), 24U); @@ -93,6 +94,7 @@ TEST(TestAudioInputProcessing, UnaccountedPacketizerBuffering) AudioInputProcessing::BufferInfo{ buffer.Elements(), nrFrames, channels, rate}, nextTime - (2 * nrFrames)); + aip->ProcessInput(graph, nullptr); aip->Pull(graph, processedTime, nextTime, segment.GetDuration(), &segment, true, &ended); EXPECT_EQ(aip->NumBufferedFrames(graph), 120U); diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index 7bfd745ccad2..b2fa23f37f88 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -1083,7 +1083,7 @@ void AudioInputProcessing::ProcessInput(MediaTrackGraphImpl* aGraph, MOZ_ASSERT(aGraph); MOZ_ASSERT(aGraph->OnGraphThread()); - if (mEnded || !mEnabled || !mLiveFramesAppended || !mInputData || !aSegment) { + if (mEnded || !mEnabled || !mLiveFramesAppended || !mInputData) { return; } @@ -1095,7 +1095,12 @@ void AudioInputProcessing::ProcessInput(MediaTrackGraphImpl* aGraph, // code. Otherwise, directly insert the mic data in the MTG, bypassing all // processing. if (PassThrough(aGraph)) { - mSegment.AppendSegment(aSegment, mPrincipal); + if (aSegment) { + mSegment.AppendSegment(aSegment, mPrincipal); + } else { + InsertInGraph(aGraph, inputInfo.mBuffer, inputInfo.mFrames, + inputInfo.mChannels); + } } else { MOZ_ASSERT(aGraph->GraphRate() == inputInfo.mRate); PacketizeAndProcess(aGraph, inputInfo.mBuffer, inputInfo.mFrames,