diff --git a/spa/examples/example-control.c b/spa/examples/example-control.c index 8b00b2118..e7e0f70cc 100644 --- a/spa/examples/example-control.c +++ b/spa/examples/example-control.c @@ -23,7 +23,6 @@ */ #include -#include #include #include #include @@ -322,8 +321,10 @@ static int make_nodes(struct data *data, const char *device) if ((res = spa_node_port_set_io(data->source, SPA_DIRECTION_OUTPUT, 0, SPA_IO_Control, - &data->ctrl, sizeof(data->ctrl))) < 0) - error(0, -res, "set_io freq"); + &data->ctrl, sizeof(data->ctrl))) < 0) { + printf("can't set_io freq: %d\n", res); + return res; + } data->source_sink_io[0] = SPA_IO_BUFFERS_INIT; diff --git a/spa/plugins/alsa/alsa-utils.c b/spa/plugins/alsa/alsa-utils.c index 1b4701704..8c2bb8d94 100644 --- a/spa/plugins/alsa/alsa-utils.c +++ b/spa/plugins/alsa/alsa-utils.c @@ -26,7 +26,8 @@ static int spa_alsa_open(struct state *state) CHECK(snd_output_stdio_attach(&state->output, stderr, 0), "attach failed"); - spa_log_info(state->log, "%p: ALSA device open '%s'", state, props->device); + spa_log_info(state->log, "%p: ALSA device open '%s' %s", state, props->device, + state->stream == SND_PCM_STREAM_CAPTURE ? "capture" : "playback"); CHECK(snd_pcm_open(&state->hndl, props->device, state->stream, diff --git a/spa/tools/spa-inspect.c b/spa/tools/spa-inspect.c index cc93b8f98..7f894b99f 100644 --- a/spa/tools/spa-inspect.c +++ b/spa/tools/spa-inspect.c @@ -22,7 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include #include #include #include @@ -94,7 +93,7 @@ inspect_node_params(struct data *data, struct spa_node *node, spa_hook_remove(&listener); if (res != 0) { - error(0, -res, "enum_params %d", params[i].id); + printf("error enum_params %d: %s", params[i].id, spa_strerror(res)); break; } } @@ -132,7 +131,7 @@ inspect_port_params(struct data *data, struct spa_node *node, spa_hook_remove(&listener); if (res != 0) { - error(0, -res, "port_enum_params %d", params[i].id); + printf("error port_enum_params %d: %s", params[i].id, spa_strerror(res)); break; } } @@ -212,10 +211,10 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory * printf("factory interfaces:\n"); for (index = 0;;) { if ((res = spa_handle_factory_enum_interface_info(factory, &info, &index)) <= 0) { - if (res == 0) - break; - else - error(0, -res, "spa_handle_factory_enum_interface_info"); + if (res != 0) + printf("error spa_handle_factory_enum_interface_info: %s", + spa_strerror(res)); + break; } printf(" interface: '%d'\n", info->type); } @@ -231,10 +230,10 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory * for (index = 0;;) { if ((res = spa_handle_factory_enum_interface_info(factory, &info, &index)) <= 0) { - if (res == 0) - break; - else - error(0, -res, "spa_handle_factory_enum_interface_info"); + if (res != 0) + printf("error spa_handle_factory_enum_interface_info: %s", + spa_strerror(res)); + break; } printf(" interface: '%d'\n", info->type); @@ -296,7 +295,7 @@ int main(int argc, char *argv[]) if ((res = enum_func(&factory, &index)) <= 0) { if (res != 0) - error(0, -res, "enum_func"); + printf("error enum_func: %s", spa_strerror(res)); break; } inspect_factory(&data, factory);