From a4af947cb793cd3b9550c76d1ea8db7d3a94612a Mon Sep 17 00:00:00 2001 From: Jian Date: Tue, 3 Feb 2015 17:08:40 +0800 Subject: [PATCH 2/4] Need to check if pa stream is still valid Fixed the issue that will report pulse server is dead when doing audio track switching. Need to check if pa stream is valid as it may be released by caps change. Upstream-Status: Submitted https://bugzilla.gnome.org/show_bug.cgi?id=743912 Signed-off-by: Jian --- ext/pulse/pulsesink.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c index 521c4a6..931f1c8 100644 --- a/ext/pulse/pulsesink.c +++ b/ext/pulse/pulsesink.c @@ -2022,6 +2022,13 @@ gst_pulsesink_get_time (GstClock * clock, GstAudioBaseSink * sink) } pa_threaded_mainloop_lock (mainloop); + + /* Need to check if pa stream is valid as it may be released by caps change*/ + if (!pbuf->stream) { + pa_threaded_mainloop_unlock (mainloop); + return GST_CLOCK_TIME_NONE; + } + if (gst_pulsering_is_dead (psink, pbuf, TRUE)) goto server_dead; -- 1.9.1