diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/file.c | 6 | ||||
-rw-r--r-- | main/rtp.c | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/main/file.c b/main/file.c index fb684755e..1bec4fca4 100644 --- a/main/file.c +++ b/main/file.c @@ -669,7 +669,8 @@ static enum fsread_res ast_readaudio_callback(struct ast_filestream *s) ast_settimeout(s->owner, whennext, ast_fsread_audio, s); else #endif - s->owner->streamid = ast_sched_add(s->owner->sched, whennext / 8, ast_fsread_audio, s); + s->owner->streamid = ast_sched_add(s->owner->sched, + whennext / (ast_format_rate(s->fmt->format) / 1000), ast_fsread_audio, s); s->lasttimeout = whennext; return FSREAD_SUCCESS_NOSCHED; } @@ -713,7 +714,8 @@ static enum fsread_res ast_readvideo_callback(struct ast_filestream *s) } if (whennext != s->lasttimeout) { - s->owner->vstreamid = ast_sched_add(s->owner->sched, whennext / 8, + s->owner->vstreamid = ast_sched_add(s->owner->sched, + whennext / (ast_format_rate(s->fmt->format) / 1000), ast_fsread_video, s); s->lasttimeout = whennext; return FSREAD_SUCCESS_NOSCHED; diff --git a/main/rtp.c b/main/rtp.c index 433fa2c79..c449b8b17 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -3186,8 +3186,14 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f) ast_smoother_feed(rtp->smoother, _f); } - while ((f = ast_smoother_read(rtp->smoother)) && (f->data)) + while ((f = ast_smoother_read(rtp->smoother)) && (f->data)) { + if (f->subclass == AST_FORMAT_G722) { + /* G.722 is silllllllllllllly */ + f->samples /= 2; + } + ast_rtp_raw_write(rtp, f, codec); + } } else { /* Don't buffer outgoing frames; send them one-per-packet: */ if (_f->offset < hdrlen) |