diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-12-11 00:10:41 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-12-11 00:10:41 +0000 |
commit | 73eabece3365c1bb47bf6b009682219c4492fda5 (patch) | |
tree | 907b66e2fe29705a512e5f3a240210590b8fe9ba /polyp/module-match.c | |
parent | 5be9641ffe18c482294c99345306c382ba4cf750 (diff) |
* add first part of zeroconf publisher
* bump version to 0.7.1.
* improve logging subsystem (introducing log levels)
* remove verbose flag on cli
* add new API pa_sample_format_to_string()
* replace strtol() by usages of pa_atou() and pa_atoi()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@317 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/module-match.c')
-rw-r--r-- | polyp/module-match.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/polyp/module-match.c b/polyp/module-match.c index 6f4fc38c..7fdc5f3e 100644 --- a/polyp/module-match.c +++ b/polyp/module-match.c @@ -88,8 +88,9 @@ static int load_rules(struct userdata *u, const char *filename) { } while (!feof(f)) { - char *d, *v, *e = NULL; + char *d, *v; pa_volume_t volume; + uint32_t k; regex_t regex; char ln[256]; struct rule *rule; @@ -114,14 +115,14 @@ static int load_rules(struct userdata *u, const char *filename) { } *d = 0; - - volume = (pa_volume_t) strtol(v, &e, 0); - - if (!e || *e) { + if (pa_atou(v, &k) < 0) { pa_log(__FILE__": [%s:%u] failed to parse volume\n", filename, n); goto finish; } + volume = (pa_volume_t) k; + + if (regcomp(®ex, ln, REG_EXTENDED|REG_NOSUB) != 0) { pa_log(__FILE__": [%s:%u] invalid regular expression\n", filename, n); goto finish; @@ -162,10 +163,8 @@ static void callback(struct pa_core *c, enum pa_subscription_event_type t, uint3 if (t != (PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_NEW)) return; - if (!(si = pa_idxset_get_by_index(c->sink_inputs, index))) { - pa_log(__FILE__": WARNING: failed to get sink input\n"); + if (!(si = pa_idxset_get_by_index(c->sink_inputs, index))) return; - } if (!si->name) return; |