[Spice-devel] [PATCH spice-gtk 5/5] audio: stop playback on channel destroyed

Marc-André Lureau marcandre.lureau at redhat.com
Wed Apr 29 08:06:48 PDT 2015


Ensure playback is stopped when the channel is destroyed.
---
 gtk/spice-gstaudio.c | 2 ++
 gtk/spice-pulse.c    | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/gtk/spice-gstaudio.c b/gtk/spice-gstaudio.c
index f3c5c20..016b19b 100644
--- a/gtk/spice-gstaudio.c
+++ b/gtk/spice-gstaudio.c
@@ -477,6 +477,8 @@ channel_weak_notified(gpointer data,
     SpiceGstaudioPrivate *p = gstaudio->priv;
 
     if (where_the_object_was == (GObject *)p->pchannel) {
+        SPICE_DEBUG("playback closed");
+        playback_stop(gstaudio);
         p->pchannel = NULL;
     } else if (where_the_object_was == (GObject *)p->rchannel) {
         SPICE_DEBUG("record closed");
diff --git a/gtk/spice-pulse.c b/gtk/spice-pulse.c
index 36955de..9c4e476 100644
--- a/gtk/spice-pulse.c
+++ b/gtk/spice-pulse.c
@@ -725,6 +725,8 @@ channel_weak_notified(gpointer data,
     SpicePulsePrivate *p = pulse->priv;
 
     if (where_the_object_was == (GObject *)p->pchannel) {
+        SPICE_DEBUG("playback closed");
+        playback_stop(pulse);
         p->pchannel = NULL;
     } else if (where_the_object_was == (GObject *)p->rchannel) {
         SPICE_DEBUG("record closed");
-- 
2.1.0



More information about the Spice-devel mailing list