From 73eabece3365c1bb47bf6b009682219c4492fda5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 11 Dec 2004 00:10:41 +0000 Subject: * 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 --- polyp/module-match.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'polyp/module-match.c') 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; -- cgit