summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-07-15 17:05:13 +0200
committerWim Taymans <wtaymans@redhat.com>2019-07-15 17:05:13 +0200
commit80face4b92a9d9c0a316deb1043340d6cfeb0c37 (patch)
treedb27a694fc2158a9f2c190acc0011cca556853d6
parentfec2915b75f4452086642ee101820e15b805c7d2 (diff)
audioadapter: handle set_io errors better
-rw-r--r--spa/plugins/audioconvert/audioadapter.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c
index f45939b0..53a8304f 100644
--- a/spa/plugins/audioconvert/audioadapter.c
+++ b/spa/plugins/audioconvert/audioadapter.c
@@ -133,12 +133,12 @@ next:
return 0;
}
-static void link_io(struct impl *this)
+static int link_io(struct impl *this)
{
int res;
if (!this->use_converter)
- return;
+ return 0;
spa_log_warn(this->log, NAME " %p: controls", this);
@@ -152,7 +152,7 @@ static void link_io(struct impl *this)
spa_log_warn(this->log, NAME " %p: set RateMatch on slave failed %d %s", this,
res, spa_strerror(res));
}
- if ((res = spa_node_port_set_io(this->convert,
+ else if ((res = spa_node_port_set_io(this->convert,
SPA_DIRECTION_REVERSE(this->direction), 0,
SPA_IO_RateMatch,
&this->io_rate_match, sizeof(this->io_rate_match))) < 0) {
@@ -168,14 +168,17 @@ static void link_io(struct impl *this)
&this->io_buffers, sizeof(this->io_buffers))) < 0) {
spa_log_warn(this->log, NAME " %p: set Buffers on slave failed %d %s", this,
res, spa_strerror(res));
+ return res;
}
- if ((res = spa_node_port_set_io(this->convert,
+ else if ((res = spa_node_port_set_io(this->convert,
SPA_DIRECTION_REVERSE(this->direction), 0,
SPA_IO_Buffers,
&this->io_buffers, sizeof(this->io_buffers))) < 0) {
spa_log_warn(this->log, NAME " %p: set Buffers on convert failed %d %s", this,
res, spa_strerror(res));
+ return res;
}
+ return 0;
}
static void emit_node_info(struct impl *this, bool full)