noteDrop method

void noteDrop()

Record that a frame was dropped (no bits emitted). The buffer still drains by one frame’s worth of target bits because the real-time clock advanced even though we sent nothing.

Implementation

void noteDrop() {
  _bufferBits -= targetBitsPerFrame;
  final windowBits = targetBitrateBps * bufferWindowSeconds;
  final clamp = 2.0 * windowBits;
  if (_bufferBits < -clamp) _bufferBits = -clamp;
  _consecutiveDrops += 1;
  _totalDropped += 1;
}