summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-11-18 12:22:10 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2009-11-18 17:27:19 +0100
commit0694be2a822f50eebaf72131358399d06fef2aa8 (patch)
treef1a729bd02ab34eb4d148d19d79f2ada443f3c75
parent1a2135ee0edf09c3ef5c58c1a4d984d3f74dd2a6 (diff)
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.
-rw-r--r--ext/pulse/pulsesink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index aec5da6af..ecf18ea39 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -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);