pulsesink: use acquired flag when checking valid state

Use the acquired field of the ringbuffer in get_time to know when we are in an
invalid state. We don't clear the rate flag when releasing the ringbuffer so
this values is not usable.

Avoids some error messages being posted because the pulseaudio connection is
down.
This commit is contained in:
Wim Taymans 2009-11-18 12:22:10 +01:00
parent 1a2135ee0e
commit 0694be2a82

View file

@ -1591,7 +1591,7 @@ gst_pulsesink_get_time (GstClock * clock, GstBaseAudioSink * sink)
GstPulseRingBuffer *pbuf;
pa_usec_t time;
if (sink->ringbuffer == NULL || sink->ringbuffer->spec.rate == 0)
if (!sink->ringbuffer || !sink->ringbuffer->acquired)
return GST_CLOCK_TIME_NONE;
pbuf = GST_PULSERING_BUFFER_CAST (sink->ringbuffer);