Bug 1656438 - Fix the unit of the desired buffering. r=padenot

Comments mention 5ms, but code says it's 50ms.

Differential Revision: https://phabricator.services.mozilla.com/D89761
This commit is contained in:
Andreas Pehrson 2020-09-15 14:42:11 +00:00
Родитель c8c26f0a4d
Коммит e1b75a875c
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -28,7 +28,7 @@ namespace mozilla {
* performance impact.
*
* The pref `media.clock drift.buffering` can be used to configure the desired
* internal buffering. Right now it is at 5ms. But it can be increased if there
* internal buffering. Right now it is at 50ms. But it can be increased if there
* are audio quality problems.
*/
class ClockDrift final {
@ -71,7 +71,7 @@ class ClockDrift final {
private:
void CalculateCorrection(int aBufferedFrames) {
// We want to maintain 4 ms buffered
// We want to maintain the desired buffer
int32_t bufferedFramesDiff = aBufferedFrames - mDesiredBuffering;
int32_t resampledSourceClock = mSourceClock + bufferedFramesDiff;
if (mTargetRate != mSourceRate) {
@ -152,7 +152,7 @@ class AudioDriftCorrection final {
public:
AudioDriftCorrection(int32_t aSourceRate, int32_t aTargetRate)
: mDesiredBuffering(
std::max(1, Preferences::GetInt("media.clockdrift.buffering", 5)) *
std::max(5, Preferences::GetInt("media.clockdrift.buffering", 50)) *
aSourceRate / 1000),
mTargetRate(aTargetRate),
mClockDrift(aSourceRate, aTargetRate, mDesiredBuffering),

Просмотреть файл

@ -6757,11 +6757,11 @@
value: false
#endif
# ClockDrift desired buffering
# ClockDrift desired buffering in milliseconds
- name: media.clockdrift.buffering
type: int32_t
mirror: always
value: 5
value: 50
# If a resource is known to be smaller than this size (in kilobytes), a
# memory-backed MediaCache may be used; otherwise the (single shared global)