From dbf24eb489ca9ae6046d1d0048c1f83afeb1e634 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 17 Sep 2007 19:23:09 +0100 Subject: [PATCH] log rtp timestamp updates (which shows that they are wrong) Organization: Straylight/Edgeware From: Richard Kettlewell --- server/speaker.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/speaker.c b/server/speaker.c index 4e79cdb..f7e2f59 100644 --- a/server/speaker.c +++ b/server/speaker.c @@ -648,9 +648,11 @@ static void play(size_t frames) { struct timeval now; xgettimeofday(&now, 0); /* There's been a gap. Fix up the RTP time accordingly. */ - rtp_time += (((now.tv_sec + now.tv_usec /1000000.0) - - (rtp_time_real.tv_sec + rtp_time_real.tv_usec / 1000000.0)) - * playing->format.rate * playing->format.channels); + const long offset = (((now.tv_sec + now.tv_usec /1000000.0) + - (rtp_time_real.tv_sec + rtp_time_real.tv_usec / 1000000.0)) + * playing->format.rate * playing->format.channels); + info("offset RTP timestamp by %ld", offset); + rtp_time += offset; } header.vpxcc = 2 << 6; /* V=2, P=0, X=0, CC=0 */ header.seq = htons(rtp_seq++); -- [mdw]