From 2a487d5fdba3b2987d2631fbd95d6ff315302f23 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 18 Feb 2020 18:04:05 +0100 Subject: [PATCH] filter: implement filter with Step Implement filter between Step and Range as if the Step were a range, ignoring the step value for now. --- spa/include/spa/pod/filter.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/spa/include/spa/pod/filter.h b/spa/include/spa/pod/filter.h index 2668ecd67..6680037c0 100644 --- a/spa/include/spa/pod/filter.h +++ b/spa/include/spa/pod/filter.h @@ -191,7 +191,10 @@ spa_pod_filter_prop(struct spa_pod_builder *b, nc->body.type = SPA_CHOICE_Enum; } - if (p1c == SPA_CHOICE_Range && p2c == SPA_CHOICE_Range) { + if ((p1c == SPA_CHOICE_Range && p2c == SPA_CHOICE_Range) || + (p1c == SPA_CHOICE_Range && p2c == SPA_CHOICE_Step) || + (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Range) || + (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Step)) { if (spa_pod_compare_value(type, alt1, alt2, size) < 0) spa_pod_builder_raw(b, alt2, size); else @@ -211,9 +214,6 @@ spa_pod_filter_prop(struct spa_pod_builder *b, if (p1c == SPA_CHOICE_None && p2c == SPA_CHOICE_Flags) return -ENOTSUP; - if (p1c == SPA_CHOICE_Range && p2c == SPA_CHOICE_Step) - return -ENOTSUP; - if (p1c == SPA_CHOICE_Range && p2c == SPA_CHOICE_Flags) return -ENOTSUP; @@ -222,11 +222,6 @@ spa_pod_filter_prop(struct spa_pod_builder *b, if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_None) return -ENOTSUP; - if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Range) - return -ENOTSUP; - - if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Step) - return -ENOTSUP; if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Enum) return -ENOTSUP; if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Flags)