From c6a355abb5c2d1c5a22daf731cbd2db50ccaa308 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Sun, 1 Dec 2019 10:52:50 +0900 Subject: [PATCH] ctl: card: emit 'disconnection' signal when detecting disconnection of sound card --- src/ctl/card.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ctl/card.c b/src/ctl/card.c index 1adf01a..e313c77 100644 --- a/src/ctl/card.c +++ b/src/ctl/card.c @@ -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) { -- 2.47.3