From 92d5c179d6bcef250d3bf6c73b4949b00e1213de Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Oct 2019 21:51:07 +0200 Subject: [PATCH] tests: set the samplerate in the format This works for now without a samplerate because we ignore it but it might not in the future.. --- spa/plugins/audioconvert/test-audioadapter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spa/plugins/audioconvert/test-audioadapter.c b/spa/plugins/audioconvert/test-audioadapter.c index a442eaa06..31ffc9c9d 100644 --- a/spa/plugins/audioconvert/test-audioadapter.c +++ b/spa/plugins/audioconvert/test-audioadapter.c @@ -73,7 +73,7 @@ static int setup_context(struct context *ctx) void *iface; logger.log.level = SPA_LOG_LEVEL_TRACE; - support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, &logger); + support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, &logger.log); /* make slave */ factory = &test_source_factory; @@ -198,6 +198,7 @@ static int test_split_setup(struct context *ctx) spa_pod_builder_init(&b, buffer, sizeof(buffer)); param = spa_format_audio_raw_build(&b, SPA_PARAM_Format, &info); + spa_log_debug(&logger.log, "set profile %d@%d", info.channels, info.rate); param = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_ParamPortConfig, SPA_PARAM_PortConfig, SPA_PARAM_PORT_CONFIG_direction, SPA_POD_Id(SPA_DIRECTION_OUTPUT), @@ -217,11 +218,13 @@ static int test_split_setup(struct context *ctx) spa_zero(info); info.format = SPA_AUDIO_FORMAT_S16; + info.rate = 44100; info.channels = 2; info.position[0] = SPA_AUDIO_CHANNEL_FL; info.position[1] = SPA_AUDIO_CHANNEL_FR; - param = spa_format_audio_raw_build(&b, SPA_PARAM_Format, &info); + param = spa_format_audio_raw_build(&b, SPA_PARAM_Format, &info); + spa_log_debug(&logger.log, "set format %d@%d", info.channels, info.rate); res = spa_node_set_param(ctx->adapter_node, SPA_PARAM_Format, 0, param); spa_assert(res == 0);