summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-09-05 01:29:07 +0200
committerLennart Poettering <lennart@poettering.net>2008-09-05 01:29:07 +0200
commitcb0c97dae7655eda60cabc06df0d1da4666392ec (patch)
tree099126b9555d00375687a61218c08ef872a2e451 /src/pulse
parent5a9a6021f12ebfcdc071d07488723ab8c0adfd5f (diff)
add new API function pa_channel_map_compatible()
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/channelmap.c7
-rw-r--r--src/pulse/channelmap.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/pulse/channelmap.c b/src/pulse/channelmap.c
index 1766e729..7a21998e 100644
--- a/src/pulse/channelmap.c
+++ b/src/pulse/channelmap.c
@@ -560,3 +560,10 @@ int pa_channel_map_valid(const pa_channel_map *map) {
return 1;
}
+
+int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *ss) {
+ pa_assert(map);
+ pa_assert(ss);
+
+ return map->channels == ss->channels;
+}
diff --git a/src/pulse/channelmap.h b/src/pulse/channelmap.h
index f9086d19..035f9b1a 100644
--- a/src/pulse/channelmap.h
+++ b/src/pulse/channelmap.h
@@ -214,6 +214,10 @@ int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) PA_GC
/** Return non-zero of the specified channel map is considered valid */
int pa_channel_map_valid(const pa_channel_map *map) PA_GCC_PURE;
+/** Return non-zero if the specified channel map is compatible with
+ * the specified sample spec. \since 0.9.12 */
+int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *ss) PA_GCC_PURE;
+
PA_C_DECL_END
#endif