[dvblast-devel] Do not enter mrtg functions if mrtg is disabled.
Christophe Massiot
git at videolan.org
Mon Nov 14 23:16:14 CET 2011
dvblast | branch: master | Christophe Massiot <massiot at via.ecp.fr> | Mon Nov 14 21:02:34 2011 +0100| [c445dada50079872651c229e9e7db522770d7e22] | committer: Christophe Massiot
Do not enter mrtg functions if mrtg is disabled.
> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=c445dada50079872651c229e9e7db522770d7e22
---
mrtg-cnt.c | 8 ++++----
mrtg-cnt.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/mrtg-cnt.c b/mrtg-cnt.c
index 0ba2c66..12a5c79 100644
--- a/mrtg-cnt.c
+++ b/mrtg-cnt.c
@@ -77,11 +77,13 @@ static void dumpCounts()
// analyse the input block counting packets and errors
// The input is a pointer to a block_t structure, which might be a linked list
// of blocks. Each block has one TS packet.
-int mrtgAnalyse(block_t * p_ts)
+void mrtgAnalyse(block_t * p_ts)
{
unsigned int i_pid;
block_t *p_block = p_ts;
-
+
+ if (mrtg_fh == NULL) return;
+
while (p_block != NULL) {
uint8_t *ts_packet = p_block->p_ts;
@@ -155,8 +157,6 @@ int mrtgAnalyse(block_t * p_ts)
}
mrtg_time.tv_sec += MRTG_INTERVAL;
}
-
- return 0;
}
int mrtgInit(char *mrtg_file)
diff --git a/mrtg-cnt.h b/mrtg-cnt.h
index ffecc93..2800453 100644
--- a/mrtg-cnt.h
+++ b/mrtg-cnt.h
@@ -27,6 +27,6 @@
int mrtgInit(char *mrtg_file);
void mrtgClose();
-int mrtgAnalyse(block_t * p_ts);
+void mrtgAnalyse(block_t * p_ts);
#endif
More information about the dvblast-devel
mailing list