adaptivedemux: Handle invalid HTTP duration
authorEdward Hervey <edward@centricular.com>
Thu, 27 Aug 2020 09:18:56 +0000 (11:18 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 9 Sep 2020 09:18:22 +0000 (11:18 +0200)
commit298eedad8bd735fe5ce266b8d0e16f7768dd878c
tree15e87da2cd0f7636fa70fb2ef245529cd2c901a6
parentd1d2acead11ced1d7daf5b22bac3c98ce18511fe
adaptivedemux: Handle invalid HTTP duration

The default BYTE DURATION basesrc query handler will return `-1` and TRUE. In
order to properly handle cases where upstream http servers didn't return a valid
Content-Length we also need to check whether it was valid when calculating
bitrates.

Avoids returning completely bogus bitrates with gogol's video streaming services

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1544>
gst-libs/gst/adaptivedemux/gstadaptivedemux.c