datachannel: Notify low buffered amount according to spec
authorPhilippe Normand <philn@igalia.com>
Wed, 18 May 2022 15:54:53 +0000 (16:54 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 19 May 2022 05:52:51 +0000 (05:52 +0000)
Quoting
https://www.w3.org/TR/webrtc/#dom-rtcdatachannel-bufferedamountlowthreshold

The bufferedAmountLowThreshold attribute sets the threshold at which the
bufferedAmount is considered to be low. When the bufferedAmount decreases from
above this threshold to **equal** or below it, the bufferedamountlow event fires.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2448>

subprojects/gst-plugins-bad/ext/webrtc/webrtcdatachannel.c

index 8b2110a..89fbd7c 100644 (file)
@@ -945,7 +945,7 @@ on_appsrc_data (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
         channel->parent.buffered_amount_low_threshold,
         channel->parent.buffered_amount);
     if (prev_amount >= channel->parent.buffered_amount_low_threshold
-        && channel->parent.buffered_amount <
+        && channel->parent.buffered_amount <=
         channel->parent.buffered_amount_low_threshold) {
       _channel_enqueue_task (channel, (ChannelTask) _emit_low_threshold, NULL,
           NULL);