summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2020-11-10 14:48:28 +0100
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-12-04 08:09:58 +0000
commita3e0083deae93f520ea795cf4c701226edeffac9 (patch)
tree71a27d4f4ce0707785b88aa13131db1d6ee260dc
parent30518de51df3e3c31168196e88dc155bb1c4606f (diff)
downloadgstreamer-plugins-bad-a3e0083deae93f520ea795cf4c701226edeffac9.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1819>
-rw-r--r--gst-libs/gst/adaptivedemux/gstadaptivedemux.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
index 99fbcd548..e32444eaa 100644
--- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
+++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
@@ -1912,17 +1912,23 @@ gst_adaptive_demux_src_event (GstPad * pad, GstObject * parent,
case GST_EVENT_QOS:{
GstClockTimeDiff diff;
GstClockTime timestamp;
+ GstClockTime earliest_time;
gst_event_parse_qos (event, NULL, NULL, &diff, &timestamp);
/* Only take into account lateness if late */
- GST_OBJECT_LOCK (demux);
if (diff > 0)
- demux->priv->qos_earliest_time = timestamp + 2 * diff;
+ earliest_time = timestamp + 2 * diff;
else
- demux->priv->qos_earliest_time = timestamp;
+ earliest_time = timestamp;
+
+ GST_OBJECT_LOCK (demux);
+ if (!GST_CLOCK_TIME_IS_VALID (demux->priv->qos_earliest_time) ||
+ earliest_time > demux->priv->qos_earliest_time) {
+ demux->priv->qos_earliest_time = earliest_time;
+ GST_DEBUG_OBJECT (demux, "qos_earliest_time %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (demux->priv->qos_earliest_time));
+ }
GST_OBJECT_UNLOCK (demux);
- GST_DEBUG_OBJECT (demux, "qos_earliest_time %" GST_TIME_FORMAT,
- GST_TIME_ARGS (demux->priv->qos_earliest_time));
break;
}
default:
@@ -4663,7 +4669,7 @@ gst_adaptive_demux_clock_callback (GstClock * clock,
*
* Returns: The QOS earliest time
*
- * Since: 1.18
+ * Since: 1.20
*/
GstClockTime
gst_adaptive_demux_get_qos_earliest_time (GstAdaptiveDemux * demux)