]> code.delx.au - pulseaudio/commitdiff
change pa_modargs_get_channel_map() to take an extra argument for specifying the...
authorLennart Poettering <lennart@poettering.net>
Wed, 12 Sep 2007 20:12:13 +0000 (20:12 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 12 Sep 2007 20:12:13 +0000 (20:12 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1813 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/modules/module-combine.c
src/pulsecore/modargs.c
src/pulsecore/modargs.h

index 390b6e5ce8b3e1470b55983b0df603ce86d8c90f..dcdc954e25c43fbeaddcc4cbe7ad50893dd08611 100644 (file)
@@ -233,7 +233,7 @@ static void thread_func(void *userdata) {
 
     pa_rtclock_get(&u->timestamp);
 
-    /* This is only run when were are in NULL mode, to make sure that
+    /* This is only run when we are in NULL mode, to make sure that
      * playback doesn't stop. In all other cases we hook our stuff
      * into the master sink. */
     
@@ -1029,7 +1029,7 @@ int pa__init(pa_module*m) {
     else
         pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_DEFAULT);
 
-    if ((pa_modargs_get_channel_map(ma, &map) < 0)) {
+    if ((pa_modargs_get_channel_map(ma, NULL, &map) < 0)) {
         pa_log("Invalid channel map.");
         goto fail;
     }
index 41e800849e775fc77f6ab5c95d93251a0d2eae62..7ce3dd087c401a4499c741a7001385a42d0f9a1e 100644 (file)
@@ -275,7 +275,7 @@ int pa_modargs_get_sample_spec(pa_modargs *ma, pa_sample_spec *rss) {
     return 0;
 }
 
-int pa_modargs_get_channel_map(pa_modargs *ma, pa_channel_map *rmap) {
+int pa_modargs_get_channel_map(pa_modargs *ma, const char *name, pa_channel_map *rmap) {
     pa_channel_map map;
     const char *cm;
 
@@ -284,7 +284,7 @@ int pa_modargs_get_channel_map(pa_modargs *ma, pa_channel_map *rmap) {
 
     map = *rmap;
 
-    if ((cm = pa_modargs_get_value(ma, "channel_map", NULL)))
+    if ((cm = pa_modargs_get_value(ma, name ? name : "channel_map", NULL)))
         if (!pa_channel_map_parse(&map, cm))
             return -1;
 
@@ -311,7 +311,7 @@ int pa_modargs_get_sample_spec_and_channel_map(pa_modargs *ma, pa_sample_spec *r
     if (!pa_channel_map_init_auto(&map, ss.channels, def))
         map.channels = 0;
 
-    if (pa_modargs_get_channel_map(ma, &map) < 0)
+    if (pa_modargs_get_channel_map(ma, NULL, &map) < 0)
         return -1;
 
     if (map.channels != ss.channels)
index 77262e1e93887c4c432826698b90d49bf148552f..aa175885d812eb9832e8e227522ee9777ba55a1f 100644 (file)
@@ -49,8 +49,8 @@ int pa_modargs_get_value_boolean(pa_modargs *ma, const char *key, int *value);
 /* Return sample spec data from the three arguments "rate", "format" and "channels" */
 int pa_modargs_get_sample_spec(pa_modargs *ma, pa_sample_spec *ss);
 
-/* Return channel map data from the argument "channel_map" */
-int pa_modargs_get_channel_map(pa_modargs *ma, pa_channel_map *map);
+/* Return channel map data from the argument "channel_map" if name is NULL, otherwise read from the specified argument */
+int pa_modargs_get_channel_map(pa_modargs *ma, const char *name, pa_channel_map *map);
 
 /* Combination of pa_modargs_get_sample_spec() and
 pa_modargs_get_channel_map(). Not always suitable, since this routine