mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
add support for automatic termination of the daemon after the last client quit
remove all gcc warnings add boolean types for tagstruct and modargs git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@178 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
fb962b67db
commit
57e473b61c
23 changed files with 155 additions and 37 deletions
|
|
@ -207,6 +207,46 @@ int pa_modargs_get_value_u32(struct pa_modargs *ma, const char *key, uint32_t *v
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_modargs_get_value_s32(struct pa_modargs *ma, const char *key, int32_t *value) {
|
||||
const char *v;
|
||||
char *e;
|
||||
signed long l;
|
||||
assert(ma && key && value);
|
||||
|
||||
if (!(v = pa_modargs_get_value(ma, key, NULL)))
|
||||
return 0;
|
||||
|
||||
if (!*v)
|
||||
return -1;
|
||||
|
||||
l = strtol(v, &e, 0);
|
||||
if (*e)
|
||||
return -1;
|
||||
|
||||
*value = (int32_t) l;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pa_modargs_get_value_boolean(struct pa_modargs *ma, const char *key, int *value) {
|
||||
const char *v;
|
||||
assert(ma && key && value);
|
||||
|
||||
if (!(v = pa_modargs_get_value(ma, key, NULL)))
|
||||
return 0;
|
||||
|
||||
if (!*v)
|
||||
return -1;
|
||||
|
||||
if (!strcmp(v, "1") || !strcasecmp(v, "yes") || !strcasecmp(v, "y") || !strcasecmp(v, "on"))
|
||||
*value = 1;
|
||||
else if (!strcmp(v, "0") || !strcasecmp(v, "no") || !strcasecmp(v, "n") || !strcasecmp(v, "off"))
|
||||
*value = 0;
|
||||
else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pa_modargs_get_sample_spec(struct pa_modargs *ma, struct pa_sample_spec *rss) {
|
||||
const char *format;
|
||||
uint32_t channels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue