]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
[servicemapper] reset stats when starting the mapper
authorSam Stenvall <neggelandia@gmail.com>
Tue, 5 Aug 2014 15:44:05 +0000 (18:44 +0300)
committerJaroslav Kysela <perex@perex.cz>
Wed, 6 Aug 2014 08:00:38 +0000 (10:00 +0200)
src/service_mapper.c
src/service_mapper.h

index c8fb56bd9d3d0255ab30f91bfa80154ff3afc9da..3c2d8446ec88929cbce741bd33fa36f631aaf0f1 100644 (file)
@@ -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;
+}
index 43f23aef6ef427e21a2e471d1c5e3031b505c018..0d974f702a1c4275c09fcfb8d1d03832c9e26a96 100644 (file)
@@ -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__ */