From 1d4c64dd9fb16762aba65404db74e778e35d0e2f Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Mon, 10 Mar 2014 22:25:41 +0000 Subject: [PATCH] Use 8kHz reference rate We're using payload 0, for which the reference rate for timestamps is 8kHz. We could use the proper payload type for Opus codec but this is not available in the installed libortp, and we are not aiming for compatibility with other applications. --- rx.c | 5 ++--- tx.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/rx.c b/rx.c index c716ea6..e24b7dc 100644 --- a/rx.c +++ b/rx.c @@ -127,10 +127,9 @@ static int run_rx(RtpSession *session, if (r == -1) return -1; - /* Follow the RFC, 48kHz is reference rate for - * timestamps */ + /* Follow the RFC, payload 0 has 8kHz reference rate */ - ts += r * 48000 / rate; + ts += r * 8000 / rate; } } diff --git a/tx.c b/tx.c index 9ca9f1b..929ff42 100644 --- a/tx.c +++ b/tx.c @@ -218,10 +218,9 @@ int main(int argc, char *argv[]) bytes_per_frame = kbps * 1024 * frame / rate / 8; - /* Follow the RFC, 48kHz is reference rate for - * timestamps */ + /* Follow the RFC, payload 0 has 8kHz reference rate */ - ts_per_frame = frame * 48000 / rate; + ts_per_frame = frame * 8000 / rate; ortp_init(); ortp_scheduler_init();