From 619b2bd1a935cd1cf1479e6297aac62de5781985 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 10 Sep 2012 12:15:25 +0200 Subject: [PATCH] pulsesrc: don't fail when not negotiated yet When get_time is called but we are not yet negotiated, return 0 instead of posting an error. It's possible that the base class is still negotiating when our get_time is called. --- ext/pulse/pulsesrc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c index 2150628..02a914c 100644 --- a/ext/pulse/pulsesrc.c +++ b/ext/pulse/pulsesrc.c @@ -1721,10 +1721,11 @@ gst_pulsesrc_get_time (GstClock * clock, GstPulseSrc * src) pa_usec_t time = 0; pa_threaded_mainloop_lock (src->mainloop); + if (!src->stream) + goto unlock_and_out; - if (gst_pulsesrc_is_dead (src, TRUE)) { + if (gst_pulsesrc_is_dead (src, TRUE)) goto unlock_and_out; - } if (pa_stream_get_time (src->stream, &time) < 0) { GST_DEBUG_OBJECT (src, "could not get time"); -- 2.7.4