From 50ce87df32636a3bf8d5562232f0dc70c4f68290 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 4 Feb 2020 12:59:16 +0100 Subject: [PATCH] node: we are supposed to produce data when != HAVE_DATA We can produce data whenever the io area status != HAVE_DATA. We don't need to look for NEED_DATA. Also recycling buffer happens whenever the status != HAVE_DATA. --- spa/plugins/alsa/alsa-seq.c | 2 +- spa/plugins/audioconvert/audioconvert.c | 2 +- spa/plugins/audiotestsrc/audiotestsrc.c | 2 +- spa/plugins/test/fakesrc.c | 3 +-- spa/plugins/videotestsrc/videotestsrc.c | 2 +- spa/plugins/vulkan/vulkan-compute-source.c | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spa/plugins/alsa/alsa-seq.c b/spa/plugins/alsa/alsa-seq.c index 675aae81d..551b3cdd0 100644 --- a/spa/plugins/alsa/alsa-seq.c +++ b/spa/plugins/alsa/alsa-seq.c @@ -425,7 +425,7 @@ static int process_recycle(struct seq_state *state) if (!port->valid || io == NULL) continue; - if (io->status == SPA_STATUS_NEED_DATA && + if (io->status != SPA_STATUS_HAVE_DATA && io->buffer_id < port->n_buffers) { spa_alsa_seq_recycle_buffer(state, port, io->buffer_id); io->buffer_id = SPA_ID_INVALID; diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 5c5285ff1..5677517ca 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -1045,7 +1045,7 @@ static int impl_node_process(void *object) spa_return_val_if_fail(this != NULL, -EINVAL); - spa_log_trace_fp(this->log, NAME " %p: process %d", this, this->n_links); + spa_log_trace_fp(this->log, NAME " %p: process %d %d", this, this->n_links, this->n_nodes); while (1) { res = SPA_STATUS_OK; diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index ce6ee0b3f..b42aad38b 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -899,7 +899,7 @@ static int impl_node_process(void *object) io->buffer_id = SPA_ID_INVALID; } - if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA)) + if (!this->props.live) return make_buffer(this); else return SPA_STATUS_OK; diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index 6f7078d14..8f29efc29 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -688,8 +688,7 @@ static int impl_node_process(void *object) io->buffer_id = SPA_ID_INVALID; } - if (this->callbacks.funcs == NULL && - (io->status == SPA_STATUS_NEED_DATA)) + if (this->callbacks.funcs == NULL) return make_buffer(this); else return SPA_STATUS_OK; diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index cf8cb8f6c..517de2b66 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -784,7 +784,7 @@ static int impl_node_process(void *object) io->buffer_id = SPA_ID_INVALID; } - if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA)) + if (!this->props.live) return make_buffer(this); else return SPA_STATUS_OK; diff --git a/spa/plugins/vulkan/vulkan-compute-source.c b/spa/plugins/vulkan/vulkan-compute-source.c index 97498d00f..4455058da 100644 --- a/spa/plugins/vulkan/vulkan-compute-source.c +++ b/spa/plugins/vulkan/vulkan-compute-source.c @@ -807,7 +807,7 @@ static int impl_node_process(void *object) io->buffer_id = SPA_ID_INVALID; } - if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA)) + if (!this->props.live) return make_buffer(this); else return SPA_STATUS_OK;