diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-30 20:24:48 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-30 20:24:48 +0000 |
commit | 191dabc708352673c7a2ede49180527d8fdaf887 (patch) | |
tree | efa8097712ebfb57060089885c15fc203e605e8a | |
parent | 50e75c0a4c10ca65112ae29502209ac65e5a8b8c (diff) |
Minor RTP video fixes, be more careful about closing fd's in meetme (bug #1743)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3111 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | apps/app_meetme.c | 6 | ||||
-rwxr-xr-x | rtp.c | 16 |
2 files changed, 14 insertions, 8 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c index dd11efbda..f9b16ce58 100755 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -465,7 +465,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c int firstpass = 0; int ret = -1; int x; - int menu_active = 0; + int menu_active = 0; + int using_pseudo = 0; struct ast_app *app; char *agifile; @@ -561,6 +562,7 @@ zapretry: ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno)); goto outrun; } + using_pseudo = 1; /* Make non-blocking */ flags = fcntl(fd, F_GETFL); if (flags < 0) { @@ -885,7 +887,7 @@ zapretry: } } } - if (fd != chan->fds[0]) + if (using_pseudo) close(fd); else { /* Take out of conference */ @@ -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 */ |