basesink: improve rate calculation

When there is no duration on input buffers, assume the rate is 1.0
instead of (the undefined) 0.0.
This commit is contained in:
Wim Taymans 2011-02-14 13:49:10 +01:00
parent 9661a713ba
commit 79665e8247

View file

@ -2706,7 +2706,7 @@ gst_base_sink_perform_qos (GstBaseSink * sink, gboolean dropped)
gst_guint64_to_gdouble (priv->avg_pt) /
gst_guint64_to_gdouble (priv->avg_duration);
else
rate = 0.0;
rate = 1.0;
if (GST_CLOCK_TIME_IS_VALID (priv->last_left)) {
if (dropped || priv->avg_rate < 0.0) {