summaryrefslogtreecommitdiff
path: root/rtp.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-30 20:24:48 +0000
committerMark Spencer <markster@digium.com>2004-05-30 20:24:48 +0000
commit0f5ed60d517c627f844b206ff76d9c67ba990dd8 (patch)
treeefa8097712ebfb57060089885c15fc203e605e8a /rtp.c
parent5ef2ef8a1d858189412ef41c906654eeb875a5eb (diff)
Minor RTP video fixes, be more careful about closing fd's in meetme (bug #1743)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/rtp.c b/rtp.c
index 5fe648dfb..c02780fab 100755
--- a/rtp.c
+++ b/rtp.c
@@ -544,6 +544,8 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
rtp->lastividtimestamp = timestamp;
rtp->f.samples = timestamp - rtp->lastividtimestamp;
rtp->lastividtimestamp = timestamp;
+ rtp->f.delivery.tv_sec = 0;
+ rtp->f.delivery.tv_usec = 0;
if (mark)
rtp->f.subclass |= 0x1;
@@ -1043,12 +1045,14 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
/* Re-calculate last TS */
rtp->lastts = rtp->lastts + ms * 90;
/* If it's close to our prediction, go for it */
- if (abs(rtp->lastts - pred) < 7200) {
- rtp->lastts = pred;
- rtp->lastovidtimestamp += f->samples;
- } else {
- ast_log(LOG_DEBUG, "Difference is %d, ms is %d\n", abs(rtp->lastts - pred), ms);
- rtp->lastovidtimestamp = rtp->lastts;
+ if (!f->delivery.tv_sec && !f->delivery.tv_usec) {
+ if (abs(rtp->lastts - pred) < 7200) {
+ rtp->lastts = pred;
+ rtp->lastovidtimestamp += f->samples;
+ } else {
+ ast_log(LOG_DEBUG, "Difference is %d, ms is %d (%d), pred/ts/samples %d/%d/%d\n", abs(rtp->lastts - pred), ms, ms * 90, rtp->lastts, pred, f->samples);
+ rtp->lastovidtimestamp = rtp->lastts;
+ }
}
}
/* Get a pointer to the header */