зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678352
- Don't GoFaster in AudioInputTrackDisabling. r=pehrsons
In retrospect this is too dependent on scheduling. We can and should do something better. This will be easier to implement once I implement real offline support for suspend/resume for offline MediaTrackGraph for OfflineAudioContext I think. Differential Revision: https://phabricator.services.mozilla.com/D123730
This commit is contained in:
Родитель
02cf484af4
Коммит
b3ed73049d
|
@ -515,7 +515,6 @@ float rmsf32(AudioDataValue* aSamples, uint32_t aChannels, uint32_t aFrames) {
|
||||||
return sqrt(rms);
|
return sqrt(rms);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifndef WIN32 // failure on windows10x32
|
|
||||||
TEST(TestAudioTrackGraph, AudioInputTrackDisabling)
|
TEST(TestAudioTrackGraph, AudioInputTrackDisabling)
|
||||||
{
|
{
|
||||||
MockCubeb* cubeb = new MockCubeb();
|
MockCubeb* cubeb = new MockCubeb();
|
||||||
|
@ -554,19 +553,12 @@ TEST(TestAudioTrackGraph, AudioInputTrackDisabling)
|
||||||
|
|
||||||
stream->SetOutputRecordingEnabled(true);
|
stream->SetOutputRecordingEnabled(true);
|
||||||
|
|
||||||
// Wait for a second worth of audio data. GoFaster is dispatched through a
|
// Wait for a second worth of audio data.
|
||||||
// ControlMessage so that it is called in the first audio driver iteration.
|
|
||||||
// Otherwise the audio driver might be going very fast while the fallback
|
|
||||||
// system clock driver is still in an iteration.
|
|
||||||
DispatchFunction([&] {
|
|
||||||
inputTrack->GraphImpl()->AppendMessage(MakeUnique<GoFaster>(cubeb));
|
|
||||||
});
|
|
||||||
uint32_t totalFrames = 0;
|
uint32_t totalFrames = 0;
|
||||||
WaitUntil(stream->FramesProcessedEvent(), [&](uint32_t aFrames) {
|
WaitUntil(stream->FramesProcessedEvent(), [&](uint32_t aFrames) {
|
||||||
totalFrames += aFrames;
|
totalFrames += aFrames;
|
||||||
return totalFrames > static_cast<uint32_t>(graph->GraphRate());
|
return totalFrames > static_cast<uint32_t>(graph->GraphRate());
|
||||||
});
|
});
|
||||||
cubeb->DontGoFaster();
|
|
||||||
|
|
||||||
const uint32_t ITERATION_COUNT = 5;
|
const uint32_t ITERATION_COUNT = 5;
|
||||||
uint32_t iterations = ITERATION_COUNT;
|
uint32_t iterations = ITERATION_COUNT;
|
||||||
|
@ -581,7 +573,6 @@ TEST(TestAudioTrackGraph, AudioInputTrackDisabling)
|
||||||
} else {
|
} else {
|
||||||
currentMode = DisabledTrackMode::SILENCE_BLACK;
|
currentMode = DisabledTrackMode::SILENCE_BLACK;
|
||||||
}
|
}
|
||||||
inputTrack->GraphImpl()->AppendMessage(MakeUnique<GoFaster>(cubeb));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
totalFrames = 0;
|
totalFrames = 0;
|
||||||
|
@ -589,7 +580,6 @@ TEST(TestAudioTrackGraph, AudioInputTrackDisabling)
|
||||||
totalFrames += aFrames;
|
totalFrames += aFrames;
|
||||||
return totalFrames > static_cast<uint32_t>(graph->GraphRate());
|
return totalFrames > static_cast<uint32_t>(graph->GraphRate());
|
||||||
});
|
});
|
||||||
cubeb->DontGoFaster();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up.
|
// Clean up.
|
||||||
|
@ -632,7 +622,6 @@ TEST(TestAudioTrackGraph, AudioInputTrackDisabling)
|
||||||
EXPECT_EQ(rmsf32(&(data[startIdx]), 2, rate / 10), 0.0);
|
EXPECT_EQ(rmsf32(&(data[startIdx]), 2, rate / 10), 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif // win32
|
|
||||||
|
|
||||||
void TestCrossGraphPort(uint32_t aInputRate, uint32_t aOutputRate,
|
void TestCrossGraphPort(uint32_t aInputRate, uint32_t aOutputRate,
|
||||||
float aDriftFactor, uint32_t aBufferMs = 50) {
|
float aDriftFactor, uint32_t aBufferMs = 50) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче