mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
pipeline: avoid using invalid clock times
Be extra careful to not use invalid clock times but give a warning instead. This should make things work better with faulty clock implementations.
This commit is contained in:
parent
d36903c1c2
commit
7590cee744
1 changed files with 7 additions and 1 deletions
|
@ -343,7 +343,13 @@ pipeline_update_start_time (GstElement * element)
|
|||
GST_OBJECT_LOCK (element);
|
||||
/* store the current running time */
|
||||
if (GST_ELEMENT_START_TIME (pipeline) != GST_CLOCK_TIME_NONE) {
|
||||
GST_ELEMENT_START_TIME (pipeline) = now - element->base_time;
|
||||
if (now != GST_CLOCK_TIME_NONE)
|
||||
GST_ELEMENT_START_TIME (pipeline) = now - element->base_time;
|
||||
else
|
||||
GST_WARNING_OBJECT ("Clock %s returned invalid time, can't calculate "
|
||||
"running_time when going to the PAUSED state",
|
||||
GST_OBJECT_NAME (clock));
|
||||
|
||||
/* we went to PAUSED, when going to PLAYING select clock and new
|
||||
* base_time */
|
||||
pipeline->priv->update_clock = TRUE;
|
||||
|
|
Loading…
Reference in a new issue