From 396d37594c8f2b1dc67561d740816060a9a3ee4e Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 7 Sep 2025 17:14:54 +0300 Subject: [PATCH] bluez5: media-source: drop all errqueue data when ignoring --- spa/plugins/bluez5/media-source.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/media-source.c b/spa/plugins/bluez5/media-source.c index e662b76d4..e151b986e 100644 --- a/spa/plugins/bluez5/media-source.c +++ b/spa/plugins/bluez5/media-source.c @@ -620,8 +620,12 @@ static void handle_errqueue(struct impl *this) } this->errqueue_count = 0; - res = recv(this->fd, NULL, 0, MSG_ERRQUEUE | MSG_TRUNC); - spa_log_trace(this->log, "%p: ignoring errqueue data (%d)", this, res); + do { + char buf[512]; + + res = recv(this->fd, buf, sizeof(buf), MSG_ERRQUEUE | MSG_TRUNC | MSG_DONTWAIT); + spa_log_trace(this->log, "%p: ignoring errqueue data (%d)", this, res); + } while (res > 0); } static void media_on_ready_read(struct spa_source *source)