mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
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
This commit is contained in:
parent
d9c4c9509d
commit
4137865815
3 changed files with 7 additions and 7 deletions
|
|
@ -233,7 +233,7 @@ static void thread_func(void *userdata) {
|
||||||
|
|
||||||
pa_rtclock_get(&u->timestamp);
|
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
|
* playback doesn't stop. In all other cases we hook our stuff
|
||||||
* into the master sink. */
|
* into the master sink. */
|
||||||
|
|
||||||
|
|
@ -1029,7 +1029,7 @@ int pa__init(pa_module*m) {
|
||||||
else
|
else
|
||||||
pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_DEFAULT);
|
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.");
|
pa_log("Invalid channel map.");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ int pa_modargs_get_sample_spec(pa_modargs *ma, pa_sample_spec *rss) {
|
||||||
return 0;
|
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;
|
pa_channel_map map;
|
||||||
const char *cm;
|
const char *cm;
|
||||||
|
|
||||||
|
|
@ -284,7 +284,7 @@ int pa_modargs_get_channel_map(pa_modargs *ma, pa_channel_map *rmap) {
|
||||||
|
|
||||||
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))
|
if (!pa_channel_map_parse(&map, cm))
|
||||||
return -1;
|
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))
|
if (!pa_channel_map_init_auto(&map, ss.channels, def))
|
||||||
map.channels = 0;
|
map.channels = 0;
|
||||||
|
|
||||||
if (pa_modargs_get_channel_map(ma, &map) < 0)
|
if (pa_modargs_get_channel_map(ma, NULL, &map) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (map.channels != ss.channels)
|
if (map.channels != ss.channels)
|
||||||
|
|
|
||||||
|
|
@ -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" */
|
/* 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);
|
int pa_modargs_get_sample_spec(pa_modargs *ma, pa_sample_spec *ss);
|
||||||
|
|
||||||
/* Return channel map data from the argument "channel_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, pa_channel_map *map);
|
int pa_modargs_get_channel_map(pa_modargs *ma, const char *name, pa_channel_map *map);
|
||||||
|
|
||||||
/* Combination of pa_modargs_get_sample_spec() and
|
/* Combination of pa_modargs_get_sample_spec() and
|
||||||
pa_modargs_get_channel_map(). Not always suitable, since this routine
|
pa_modargs_get_channel_map(). Not always suitable, since this routine
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue