From: Lennart Poettering Date: Wed, 12 Sep 2007 20:12:13 +0000 (+0000) Subject: change pa_modargs_get_channel_map() to take an extra argument for specifying the... X-Git-Tag: submit/2.0-panda/20130828.192557~2837^2~1^2~157 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41378658153585c82eebca83d280b25f684e90c4;p=profile%2Fivi%2Fpulseaudio-panda.git change pa_modargs_get_channel_map() to take an extra argument for specifying the name of the modargs attribute to parse git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1813 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c index 390b6e5..dcdc954 100644 --- a/src/modules/module-combine.c +++ b/src/modules/module-combine.c @@ -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; } diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c index 41e8008..7ce3dd0 100644 --- a/src/pulsecore/modargs.c +++ b/src/pulsecore/modargs.c @@ -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) diff --git a/src/pulsecore/modargs.h b/src/pulsecore/modargs.h index 77262e1..aa17588 100644 --- a/src/pulsecore/modargs.h +++ b/src/pulsecore/modargs.h @@ -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