queue2: Fix average input rate calculation on small input range
authorEdward Hervey <edward@centricular.com>
Mon, 11 Jul 2016 07:58:47 +0000 (09:58 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 11 Jul 2016 08:08:44 +0000 (10:08 +0200)
commit1ff80fbf525a56ba0b79031ad49341caa2820abf
tree1fa77ac15e201c00c5f587ca4b4e57fd7d756dbc
parente73650e5f99dac178ee401438008c43b6a32e247
queue2: Fix average input rate calculation on small input range

When dealing with small-ish input data coming into queue2, such as
adaptivedemux fragments, we would never take into account the last
<200ms of data coming in.

The problem is that usually on TCP connection the download rate
gradually increases (i.e. the rate is lower at the beginning of a
download than it is later on). Combined with small download time (less
than a second) we would end up with a computed average input rate
which was sometimes up to 30-50% off from the *actual* average input
rate for that fragment.

In order to fix this, force the average input rate calculation when
we receive an EOS so that we take into account that final window
of data.

https://bugzilla.gnome.org/show_bug.cgi?id=768649
plugins/elements/gstqueue2.c