mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
basesink: use GST_CLOCK_TIME macros for readability
Replace some -1 comparison with GST_CLOCK_TIME macros.
This commit is contained in:
parent
7a4df51b08
commit
2ace5f4191
1 changed files with 7 additions and 6 deletions
|
@ -1953,7 +1953,7 @@ again:
|
||||||
}
|
}
|
||||||
|
|
||||||
rstart = rstop = rnext = priv->eos_rtime;
|
rstart = rstop = rnext = priv->eos_rtime;
|
||||||
*do_sync = rstart != -1;
|
*do_sync = GST_CLOCK_TIME_IS_VALID (rstart);
|
||||||
GST_DEBUG_OBJECT (basesink, "sync times for EOS %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (basesink, "sync times for EOS %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (rstart));
|
GST_TIME_ARGS (rstart));
|
||||||
/* if we are stepping, we end now */
|
/* if we are stepping, we end now */
|
||||||
|
@ -1986,8 +1986,8 @@ again:
|
||||||
/* else do buffer sync code */
|
/* else do buffer sync code */
|
||||||
GstBuffer *buffer = GST_BUFFER_CAST (obj);
|
GstBuffer *buffer = GST_BUFFER_CAST (obj);
|
||||||
|
|
||||||
/* just get the times to see if we need syncing, if the start returns -1 we
|
/* just get the times to see if we need syncing, if the retuned start is -1
|
||||||
* don't sync. */
|
* we don't sync. */
|
||||||
if (bclass->get_times)
|
if (bclass->get_times)
|
||||||
bclass->get_times (basesink, buffer, &start, &stop);
|
bclass->get_times (basesink, buffer, &start, &stop);
|
||||||
|
|
||||||
|
@ -2536,7 +2536,8 @@ do_step:
|
||||||
priv->eos_rtime = (do_sync ? rnext : GST_CLOCK_TIME_NONE);
|
priv->eos_rtime = (do_sync ? rnext : GST_CLOCK_TIME_NONE);
|
||||||
|
|
||||||
/* calculate inter frame spacing */
|
/* calculate inter frame spacing */
|
||||||
if (G_UNLIKELY (priv->prev_rstart != -1 && priv->prev_rstart < rstart)) {
|
if (G_UNLIKELY (GST_CLOCK_TIME_IS_VALID (priv->prev_rstart) &&
|
||||||
|
priv->prev_rstart < rstart)) {
|
||||||
GstClockTime in_diff;
|
GstClockTime in_diff;
|
||||||
|
|
||||||
in_diff = rstart - priv->prev_rstart;
|
in_diff = rstart - priv->prev_rstart;
|
||||||
|
@ -2552,8 +2553,8 @@ do_step:
|
||||||
}
|
}
|
||||||
priv->prev_rstart = rstart;
|
priv->prev_rstart = rstart;
|
||||||
|
|
||||||
if (G_UNLIKELY (priv->earliest_in_time != -1
|
if (G_UNLIKELY (GST_CLOCK_TIME_IS_VALID (priv->earliest_in_time) &&
|
||||||
&& rstart < priv->earliest_in_time))
|
rstart < priv->earliest_in_time))
|
||||||
goto qos_dropped;
|
goto qos_dropped;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
|
|
Loading…
Reference in a new issue