chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
210d172
)
rtpmon now reports once a second, rather than based on numbers of
author
Richard Kettlewell
<rjk@greenend.org.uk>
Sat, 11 Apr 2009 09:33:13 +0000
(10:33 +0100)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Sat, 11 Apr 2009 09:33:13 +0000
(10:33 +0100)
packets received.
clients/rtpmon.c
patch
|
blob
|
blame
|
history
diff --git
a/clients/rtpmon.c
b/clients/rtpmon.c
index 66e2f0130e0ba5824730bb0b617bc6837d8a0803..cf83328e0e1a76a1157f9ccda1af9632db95ee07 100644
(file)
--- a/
clients/rtpmon.c
+++ b/
clients/rtpmon.c
@@
-104,13
+104,14
@@
static double rate(unsigned earlier, unsigned later) {
* @param n How many frames of audio data we received
*/
static void frames(const struct timeval *when, size_t n) {
* @param n How many frames of audio data we received
*/
static void frames(const struct timeval *when, size_t n) {
+ const time_t prev = ring[(ringtail - 1) % RINGSIZE].when.tv_sec;
+
ring[ringtail].when = *when;
ring[ringtail].serial = serial;
serial += n;
ringtail = (ringtail + 1) % RINGSIZE;
ring[ringtail].when = *when;
ring[ringtail].serial = serial;
serial += n;
ringtail = (ringtail + 1) % RINGSIZE;
- // Report rates every couple of hundred packets
- if(!(ringtail & 1023)) {
-
+ // Report once a second
+ if(prev != when->tv_sec) {
if(printf("%8.2f %8.2f %8.2f\n",
rate((ringtail - RINGSIZE / 8) % RINGSIZE,
(ringtail - 1) % RINGSIZE),
if(printf("%8.2f %8.2f %8.2f\n",
rate((ringtail - RINGSIZE / 8) % RINGSIZE,
(ringtail - 1) % RINGSIZE),