]> code.delx.au - pulseaudio/commitdiff
add new API function pa_channel_map_compatible()
authorLennart Poettering <lennart@poettering.net>
Thu, 4 Sep 2008 23:29:07 +0000 (01:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 4 Sep 2008 23:29:07 +0000 (01:29 +0200)
src/pulse/channelmap.c
src/pulse/channelmap.h

index 1766e7291eb5c5fc84376bcd76f7d2d0f4d3604d..7a21998edb432c155ac1fa3f2e9f9c211c884ef8 100644 (file)
@@ -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;
+}
index f9086d1961b0f919921c9088035a167585b04bb7..035f9b1a1c8ed902e698149dc7fa4bd37d19b5ff 100644 (file)
@@ -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