mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +00:00
baseaudiosink: take clock time in setcaps
Take the time of the clock so that the last_time field is set. This is important for sinks that restart their internal ringbuffer after a caps change and need to know the last know position.
This commit is contained in:
parent
451789735c
commit
06be2b8632
1 changed files with 6 additions and 0 deletions
|
@ -625,6 +625,7 @@ gst_base_audio_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
{
|
||||
GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (bsink);
|
||||
GstRingBufferSpec *spec;
|
||||
GstClockTime now;
|
||||
|
||||
if (!sink->ringbuffer)
|
||||
return FALSE;
|
||||
|
@ -633,6 +634,11 @@ gst_base_audio_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
|
||||
GST_DEBUG_OBJECT (sink, "release old ringbuffer");
|
||||
|
||||
/* get current time, updates the last_time */
|
||||
now = gst_clock_get_time (sink->provided_clock);
|
||||
|
||||
GST_DEBUG_OBJECT (sink, "time was %" GST_TIME_FORMAT, GST_TIME_ARGS (now));
|
||||
|
||||
/* release old ringbuffer */
|
||||
gst_ring_buffer_pause (sink->ringbuffer);
|
||||
gst_ring_buffer_activate (sink->ringbuffer, FALSE);
|
||||
|
|
Loading…
Reference in a new issue