1
0
mirror of http://www.pogo.org.uk/~mark/trx.git synced 2024-11-21 18:05:06 +01:00

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.
This commit is contained in:
Mark Hills 2014-03-10 22:25:41 +00:00
parent 55d398c46c
commit 1d4c64dd9f
2 changed files with 4 additions and 6 deletions

5
rx.c
View File

@ -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;
}
}

5
tx.c
View File

@ -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();