[Spice-devel] [PATCH spice-gtk] pulse: do not abort on corking no stream

Marc-André Lureau marcandre.lureau at gmail.com
Mon Nov 25 04:33:52 PST 2013


Check that there is an actual stream before calling cork().

https://bugzilla.redhat.com/show_bug.cgi?id=1032785
---
 gtk/spice-pulse.c | 5 ++++-
 spice-common      | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gtk/spice-pulse.c b/gtk/spice-pulse.c
index 5e214c8..c4241d0 100644
--- a/gtk/spice-pulse.c
+++ b/gtk/spice-pulse.c
@@ -161,6 +161,8 @@ static void stream_uncork(SpicePulse *pulse, struct stream *s)
     SpicePulsePrivate *p = SPICE_PULSE_GET_PRIVATE(pulse);
     pa_operation *o = NULL;
 
+    g_return_if_fail(s->stream);
+
     if (s->cork_op) {
         pa_operation_cancel(s->cork_op);
         pa_operation_unref(s->cork_op);
@@ -671,7 +673,8 @@ static void playback_min_latency_changed(GObject *object, GParamSpec *pspec, gpo
 
     if (p->last_delay < p->target_delay) {
         spice_debug("%s: corking", __FUNCTION__);
-        stream_cork(pulse, &p->playback, FALSE);
+        if (p->playback.stream)
+            stream_cork(pulse, &p->playback, FALSE);
     } else {
         spice_debug("%s: not corking. The current delay satisfies the requirement", __FUNCTION__);
     }
diff --git a/spice-common b/spice-common
index 261d270..cacc07f 160000
--- a/spice-common
+++ b/spice-common
@@ -1 +1 @@
-Subproject commit 261d270cc8e9af0915d5248df240828214ec996e
+Subproject commit cacc07ff6a5b5f2c9c37177d83668cb3cdc2aba0
-- 
1.8.4.2



More information about the Spice-devel mailing list