[Pkg-voip-commits] [janus] 102/163: Fixed playout of G.711 and G.722 recordings in Record&Play
Jonas Smedegaard
dr at jones.dk
Sat Oct 28 01:22:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/0.2.5-1
in repository janus.
commit 9650fb74df9eb0784949d7bd4214dba0ad16b0f2
Author: Lorenzo Miniero <lminiero at gmail.com>
Date: Thu Sep 7 14:57:07 2017 +0200
Fixed playout of G.711 and G.722 recordings in Record&Play
---
plugins/janus_recordplay.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/plugins/janus_recordplay.c b/plugins/janus_recordplay.c
index 966a42a..de9486c 100644
--- a/plugins/janus_recordplay.c
+++ b/plugins/janus_recordplay.c
@@ -2158,6 +2158,11 @@ static void *janus_recordplay_playout_thread(void *data) {
int audio_pt = session->recording->audio_pt;
int video_pt = session->recording->video_pt;
+ int akhz = 48;
+ if(audio_pt == 0 || audio_pt == 8 || audio_pt == 9)
+ akhz = 8;
+ int vkhz = 90;
+
while(!session->destroyed && session->active && !session->recording->destroyed && (audio || video)) {
if(!asent && !vsent) {
/* We skipped the last round, so sleep a bit (5ms) */
@@ -2185,7 +2190,7 @@ static void *janus_recordplay_playout_thread(void *data) {
} else {
/* What's the timestamp skip from the previous packet? */
ts_diff = audio->ts - audio->prev->ts;
- ts_diff = (ts_diff*1000)/48; /* FIXME We're assuming Opus and 48khz */
+ ts_diff = (ts_diff*1000)/akhz;
/* Check if it's time to send */
gettimeofday(&now, NULL);
d_s = now.tv_sec - abefore.tv_sec;
@@ -2246,7 +2251,7 @@ static void *janus_recordplay_playout_thread(void *data) {
} else {
/* What's the timestamp skip from the previous packet? */
ts_diff = video->ts - video->prev->ts;
- ts_diff = (ts_diff*1000)/90;
+ ts_diff = (ts_diff*1000)/vkhz;
/* Check if it's time to send */
gettimeofday(&now, NULL);
d_s = now.tv_sec - vbefore.tv_sec;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git
More information about the Pkg-voip-commits
mailing list