diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-11-28 22:29:29 +0100 |
---|---|---|
committer | Wim Taymans <wim@metal.(none)> | 2009-11-28 22:34:19 +0100 |
commit | 8d34217dcc9d27e7113041ada68955eff3b98c34 (patch) | |
tree | 8531a221b68e556f37cf2c7a9e390128f6826b6d | |
parent | 9ea9f9a81611907d395c57afb43a328d30296173 (diff) |
basesink: clip stepping boundaries
Rounding errors with the floating point rate could make it so that we
don't end up exactly at the required stepping duration.
Use the segment clipping boundaries, which are not subject to rate
adjustements, instead to detect when we reached the stepping duration.
Add some debug info related to going to the PAUSED state.
-rw-r--r-- | libs/gst/base/gstbasesink.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 104f3e26b0..6ed16ff170 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -1646,9 +1646,15 @@ handle_stepping (GstBaseSink * sink, GstSegment * segment, gint64 first, last; if (segment->rate > 0.0) { + if (segment->stop == *cstop) + *rstop = *rstart + current->amount; + first = *rstart; last = *rstop; } else { + if (segment->start == *cstart) + *rstart = *rstop + current->amount; + first = *rstop; last = *rstart; } @@ -4684,6 +4690,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) bclass->unlock (basesink); GST_PAD_PREROLL_LOCK (basesink->sinkpad); + GST_DEBUG_OBJECT (basesink, "got preroll lock"); /* now that we have the PREROLL lock, clear our unlock request */ if (bclass->unlock_stop) bclass->unlock_stop (basesink); @@ -4694,6 +4701,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) basesink->need_preroll = TRUE; if (basesink->clock_id) { + GST_DEBUG_OBJECT (basesink, "unschedule clock"); gst_clock_id_unschedule (basesink->clock_id); } @@ -4704,6 +4712,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) basesink->playing_async = FALSE; } else { if (GST_STATE_TARGET (GST_ELEMENT (basesink)) <= GST_STATE_READY) { + GST_DEBUG_OBJECT (basesink, "element is <= READY"); ret = GST_STATE_CHANGE_SUCCESS; } else { GST_DEBUG_OBJECT (basesink, |