зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1656438 - Only raise the FramesProcessedEvent once there is no silence. r=padenot
Because an audio driver starts out with its fallback driver running the graph, we might use unnecessary amounts of silence for the verification. Especially with the `GoFaster()` mode turned on, as the fallback driver's thread runs rarely compared to how often we are feeding the graph audio data from the MockCubebStream. Differential Revision: https://phabricator.services.mozilla.com/D89753
This commit is contained in:
Родитель
0d8d6e6a2d
Коммит
9962c2e6af
|
@ -56,6 +56,9 @@ class AudioVerifier {
|
||||||
sin(2 * M_PI * mFrequency / mRate));
|
sin(2 * M_PI * mFrequency / mRate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PreSilenceEnded() const {
|
||||||
|
return mTotalFramesSoFar > mPreSilenceSamples;
|
||||||
|
}
|
||||||
uint64_t PreSilenceSamples() const { return mPreSilenceSamples; }
|
uint64_t PreSilenceSamples() const { return mPreSilenceSamples; }
|
||||||
uint32_t CountDiscontinuities() const { return mDiscontinuitiesCount; }
|
uint32_t CountDiscontinuities() const { return mDiscontinuitiesCount; }
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,9 @@ class MockCubebStream {
|
||||||
mAudioVerifier.AppendDataInterleaved(mOutputBuffer, outframes,
|
mAudioVerifier.AppendDataInterleaved(mOutputBuffer, outframes,
|
||||||
NUM_OF_CHANNELS);
|
NUM_OF_CHANNELS);
|
||||||
|
|
||||||
|
if (mAudioVerifier.PreSilenceEnded()) {
|
||||||
mFramesProcessedEvent.Notify(outframes);
|
mFramesProcessedEvent.Notify(outframes);
|
||||||
|
}
|
||||||
|
|
||||||
if (outframes < NUM_OF_FRAMES) {
|
if (outframes < NUM_OF_FRAMES) {
|
||||||
mStateCallback(stream, mUserPtr, CUBEB_STATE_DRAINED);
|
mStateCallback(stream, mUserPtr, CUBEB_STATE_DRAINED);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче