From 90ea120d3cadfc3461f7db1bc1115bc104dfb56e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 19 Apr 2017 13:06:03 +0200 Subject: [PATCH] audiomixer: don't mix when no input Give the app a chance to provide some input when there is nothing to mix anymore in process_output. alsa: fix buffer size --- spa/plugins/alsa/alsa-monitor.c | 6 +++--- spa/plugins/audiomixer/audiomixer.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c index 2d397e450..573770db8 100644 --- a/spa/plugins/alsa/alsa-monitor.c +++ b/spa/plugins/alsa/alsa-monitor.c @@ -73,7 +73,7 @@ struct _SpaALSAMonitor { snd_ctl_t *ctl_hndl; struct udev_device *dev; - char card_name[64]; + char card_name[16]; int dev_idx; int stream_idx; @@ -144,7 +144,7 @@ fill_item (SpaALSAMonitor *this, if (!(name && *name)) name = "Unknown"; - snprintf (card_name, 63, "%s,%d", this->card_name, snd_pcm_info_get_device (dev_info)); + snprintf (card_name, 64, "%s,%d", this->card_name, snd_pcm_info_get_device (dev_info)); spa_pod_builder_add (&b, SPA_POD_TYPE_OBJECT, &f[0], 0, this->type.monitor.MonitorItem, @@ -261,7 +261,7 @@ open_card (SpaALSAMonitor *this, struct udev_device *dev) if ((str = path_get_card_id (udev_device_get_property_value (dev, "DEVPATH"))) == NULL) return -1; - snprintf (this->card_name, 63, "hw:%s", str); + snprintf (this->card_name, 16, "hw:%s", str); if ((err = snd_ctl_open (&this->ctl_hndl, this->card_name, 0)) < 0) { spa_log_error (this->log, "can't open control for card %s: %s", this->card_name, snd_strerror (err)); diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index 46f16b49a..cbba233ab 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -780,7 +780,7 @@ spa_audiomixer_node_process_output (SpaNode *node) if (port->io == NULL || port->n_buffers == 0) continue; - if (port->queued_bytes > 0 && port->queued_bytes < min_queued) + if (port->queued_bytes < min_queued) min_queued = port->queued_bytes; } if (min_queued != SIZE_MAX && min_queued > 0) {