]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
ctl: card: emit 'disconnection' signal when detecting disconnection of sound card
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 1 Dec 2019 01:52:50 +0000 (10:52 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 12 Dec 2019 05:29:12 +0000 (14:29 +0900)
src/ctl/card.c

index 1adf01a1ac26e35eb74d708bbd02844a99a8b5d1..e313c77c1f4d61fb1a9fcf382cdf2c0dfff00dd8 100644 (file)
@@ -773,8 +773,12 @@ static gboolean ctl_card_dispatch_src(GSource *gsrc, GSourceFunc cb,
         return G_SOURCE_REMOVE;
 
     condition = g_source_query_unix_fd(gsrc, src->tag);
-    if (condition & G_IO_ERR)
+    if (condition & G_IO_ERR) {
+        g_signal_emit(self,
+                      ctl_card_sigs[CTL_CARD_SIG_HANDLE_DISCONNECTION],
+                      0, NULL);
         return G_SOURCE_REMOVE;
+    }
 
     len = read(priv->fd, src->buf, src->buf_len);
     if (len < 0) {