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 <Jian.Li@freescale.com>
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 @@
   }
 
   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;