From e700a21993c0f57427d72a7b72236441df16303a Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 10 Nov 2020 14:48:28 +0100 Subject: [PATCH] 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 66f5e874352016e29f555e3ce693b23474e476db Part-of: --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index 8149a2ae71..e74a009815 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -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));