adaptivedemux: Don't calculate bitrate for header/index fragments

They are generally substantially smaller than regular fragments, and therefore
we end up pushing totally wrong bitrates downstream.

Fixes erratic buffering issues with DASH introduced by
66f5e87435

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1786>
This commit is contained in:
Edward Hervey 2020-11-10 14:48:28 +01:00 committed by GStreamer Merge Bot
parent a4b20ed276
commit e700a21993

View file

@ -2773,7 +2773,8 @@ gst_adaptive_demux_eos_handling (GstAdaptiveDemuxStream * stream)
/* Last chance to figure out a fallback nominal bitrate if neither baseclass
nor the HTTP Content-Length implementation worked. */
if (stream->fragment.bitrate == 0 && stream->fragment.duration != 0 &&
stream->fragment_bytes_downloaded != 0) {
stream->fragment_bytes_downloaded != 0 && !stream->downloading_index &&
!stream->downloading_header) {
guint bitrate = MIN (G_MAXUINT,
gst_util_uint64_scale (stream->fragment_bytes_downloaded,
8 * GST_SECOND, stream->fragment.duration));