Commit 06be2b86 authored by Wim Taymans's avatar Wim Taymans

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.
parent 45178973
......@@ -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);
/* release old ringbuffer */
gst_ring_buffer_pause (sink->ringbuffer);
gst_ring_buffer_activate (sink->ringbuffer, FALSE);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment