From 1ede97577bd94eb01111a6b31e35976312a1c819 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 8 May 2018 12:23:23 +0200 Subject: [PATCH] small cleanups --- spa/plugins/alsa/alsa-monitor.c | 6 +++--- spa/plugins/audioconvert/fmtconvert.c | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c index e6bcc9417..d4b58d188 100644 --- a/spa/plugins/alsa/alsa-monitor.c +++ b/spa/plugins/alsa/alsa-monitor.c @@ -133,7 +133,7 @@ fill_item(struct impl *this, snd_ctl_card_info_t *card_info, { const char *str, *name, *klass = NULL; const struct spa_handle_factory *factory = NULL; - char device_name[64], id[64]; + char device_name[64], id[66]; struct type *t = &this->type; struct udev_device *dev = card->dev; struct device *device; @@ -153,13 +153,13 @@ fill_item(struct impl *this, snd_ctl_card_info_t *card_info, factory = &spa_alsa_sink_factory; klass = "Audio/Sink"; SPA_FLAG_SET(device->flags, DEVICE_FLAG_PLAYBACK); - snprintf(id, 64, "%s/P", device_name); + snprintf(id, 66, "%s/P", device_name); break; case SND_PCM_STREAM_CAPTURE: factory = &spa_alsa_source_factory; klass = "Audio/Source"; SPA_FLAG_SET(device->flags, DEVICE_FLAG_RECORD); - snprintf(id, 64, "%s/C", device_name); + snprintf(id, 66, "%s/C", device_name); break; default: return -1; diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index b299eea1e..f1a40e929 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -786,6 +786,7 @@ static int impl_node_process(struct spa_node *node) struct port *outport, *inport; struct spa_io_buffers *outio, *inio; struct buffer *sbuf, *dbuf; + int res = 0; spa_return_val_if_fail(node != NULL, -EINVAL); @@ -851,13 +852,15 @@ static int impl_node_process(struct spa_node *node) if (inport->offset >= size) { inio->status = SPA_STATUS_NEED_BUFFER; inport->offset = 0; + res |= SPA_STATUS_NEED_BUFFER; } } outio->status = SPA_STATUS_HAVE_BUFFER; outio->buffer_id = dbuf->outbuf->id; + res |= SPA_STATUS_HAVE_BUFFER; - return outio->status; + return res; } static const struct spa_node impl_node = {