Skip to content
Browse files
[MSE] Adjust buffering rate monitor to react faster

Reviewed by Xabier Rodriguez-Calvar.

As data is comming in (in bursts), the buffering rate monitoring algorithm calculates an
average rate that will be used to determine if we can play through the content without
interruption (assuming relatively constant rate). To filter out variations in rate, the
algorithm reacts more slowly (by design) and may take more time to reach the required rate
threshold to unblock playback, even though the incoming rate is sufficient to sustain
playback. If it takes too long, then a client using MSE may take corrective actions wich may
disturb or even abort the playback.

By adjusting the 'ExponentialMovingAverageCoefficient' we can make the algorithm react
faster to presence of data and unblock playback. Side effect is that it reacts also faster
to absence of data, but that should not affect playback as data has been buffered already
allowing playback to be sustained.

Original author: Pawel Lampe <>
See: WebPlatformForEmbedded/WPEWebKit#927
See: WebPlatformForEmbedded/WPEWebKit#928

* Source/WebCore/Modules/mediasource/SourceBuffer.cpp: Adjust ExponentialMovingAverageCoefficient from 0.1 to 0.2.

Canonical link:
  • Loading branch information
eocanha committed Sep 23, 2022
1 parent 0c43783 commit 68d7d604b06e9bc2658348bb6960ab3886851b9f
Showing 1 changed file with 1 addition and 1 deletion.
@@ -68,7 +68,7 @@ namespace WebCore {


static const double ExponentialMovingAverageCoefficient = 0.1;
static const double ExponentialMovingAverageCoefficient = 0.2;

Ref<SourceBuffer> SourceBuffer::create(Ref<SourceBufferPrivate>&& sourceBufferPrivate, MediaSource* source)

0 comments on commit 68d7d60

Please sign in to comment.