From: Sam Stenvall Date: Tue, 5 Aug 2014 15:44:05 +0000 (+0300) Subject: [servicemapper] reset stats when starting the mapper X-Git-Tag: v4.1~1633 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d638f25225a67efa31423d0bb745f15385bf93a5;p=thirdparty%2Ftvheadend.git [servicemapper] reset stats when starting the mapper --- diff --git a/src/service_mapper.c b/src/service_mapper.c index c8fb56bd9..3c2d8446e 100644 --- a/src/service_mapper.c +++ b/src/service_mapper.c @@ -78,6 +78,9 @@ service_mapper_start ( const service_mapper_conf_t *conf, htsmsg_t *uuids ) int e, tr, qd = 0; service_t *s; + /* Reset stat counters */ + service_mapper_reset_stats(); + /* Store config */ service_mapper_conf = *conf; @@ -432,3 +435,13 @@ service_mapper_thread ( void *aux ) pthread_mutex_unlock(&global_lock); return NULL; } + +void +service_mapper_reset_stats (void) +{ + service_mapper_stat.total = 0; + service_mapper_stat.ok = 0; + service_mapper_stat.ignore = 0; + service_mapper_stat.fail = 0; + service_mapper_stat.active = NULL; +} diff --git a/src/service_mapper.h b/src/service_mapper.h index 43f23aef6..0d974f702 100644 --- a/src/service_mapper.h +++ b/src/service_mapper.h @@ -72,4 +72,7 @@ void service_mapper_unlink ( struct service *s, struct channel *c, void *origin */ int service_mapper_clean ( struct service *s, struct channel *ch, void *origin ); +// Resets the stat counters +void service_mapper_reset_stats ( void ); + #endif /* __TVH_SERVICE_MAPPER_H__ */