mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
basesink: improve average duration calculation
Improve the calculation of the duration. When we have no input duration set on the input buffers stop is set to start and then we end up using a 0 duration in the average calculation.
This commit is contained in:
parent
dc0120fe28
commit
9661a713ba
1 changed files with 6 additions and 6 deletions
|
@ -2660,7 +2660,7 @@ gst_base_sink_perform_qos (GstBaseSink * sink, gboolean dropped)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calculate duration of the buffer */
|
/* calculate duration of the buffer */
|
||||||
if (GST_CLOCK_TIME_IS_VALID (stop))
|
if (GST_CLOCK_TIME_IS_VALID (stop) && stop != start)
|
||||||
duration = stop - start;
|
duration = stop - start;
|
||||||
else
|
else
|
||||||
duration = GST_CLOCK_TIME_NONE;
|
duration = GST_CLOCK_TIME_NONE;
|
||||||
|
@ -2678,11 +2678,11 @@ gst_base_sink_perform_qos (GstBaseSink * sink, gboolean dropped)
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, sink, "start: %" GST_TIME_FORMAT
|
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, sink, "start: %" GST_TIME_FORMAT
|
||||||
", entered %" GST_TIME_FORMAT ", left %" GST_TIME_FORMAT ", pt: %"
|
", stop %" GST_TIME_FORMAT ", entered %" GST_TIME_FORMAT ", left %"
|
||||||
GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT ",jitter %"
|
GST_TIME_FORMAT ", pt: %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT
|
||||||
G_GINT64_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (entered),
|
",jitter %" G_GINT64_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
|
||||||
GST_TIME_ARGS (left), GST_TIME_ARGS (pt), GST_TIME_ARGS (duration),
|
GST_TIME_ARGS (entered), GST_TIME_ARGS (left), GST_TIME_ARGS (pt),
|
||||||
jitter);
|
GST_TIME_ARGS (duration), jitter);
|
||||||
|
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, sink, "avg_duration: %" GST_TIME_FORMAT
|
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, sink, "avg_duration: %" GST_TIME_FORMAT
|
||||||
", avg_pt: %" GST_TIME_FORMAT ", avg_rate: %g",
|
", avg_pt: %" GST_TIME_FORMAT ", avg_rate: %g",
|
||||||
|
|
Loading…
Reference in a new issue