aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/filter/route_filter_plugin.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/filter/route_filter_plugin.c b/src/filter/route_filter_plugin.c
index a90abe56f..7fef2bc12 100644
--- a/src/filter/route_filter_plugin.c
+++ b/src/filter/route_filter_plugin.c
@@ -178,6 +178,14 @@ route_filter_parse(const struct config_param *param,
g_strfreev(sd);
}
+ if (!audio_valid_channel_count(filter->min_output_channels)) {
+ g_strfreev(tokens);
+ g_set_error(error_r, audio_format_quark(), 0,
+ "Invalid number of output channels requested: %d",
+ filter->min_output_channels);
+ return false;
+ }
+
// Allocate a map of "copy nothing to me"
filter->sources =
g_malloc(filter->min_output_channels * sizeof(signed char));
@@ -242,7 +250,7 @@ route_filter_finish(struct filter *_filter)
static const struct audio_format *
route_filter_open(struct filter *_filter,
const struct audio_format *audio_format,
- GError **error_r)
+ G_GNUC_UNUSED GError **error_r)
{
struct route_filter *filter = (struct route_filter *)_filter;
@@ -251,13 +259,6 @@ route_filter_open(struct filter *_filter,
filter->input_frame_size =
audio_format_frame_size(&filter->input_format);
- if (!audio_valid_channel_count(filter->min_output_channels)) {
- g_set_error(error_r, audio_format_quark(), 2,
- "Invalid number of output channels requested: %d",
- filter->min_output_channels);
- return NULL;
- }
-
// Decide on an output format which has enough channels,
// and is otherwise identical
filter->output_format = *audio_format;