aboutsummaryrefslogtreecommitdiffstats
path: root/formats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2000-07-24 03:28:43 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2000-07-24 03:28:43 +0000
commitaec2c7f22df13c6d3508b5930890099f62aab8c8 (patch)
tree534acece8a917d089a02de2cfe5d2ff675eb797c /formats
parent1da28f7cc934d2cd99050619f8b82062d763e9c8 (diff)
Version 0.1.4 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats')
-rwxr-xr-xformats/format_g723.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/formats/format_g723.c b/formats/format_g723.c
index e72c3c644..83144376f 100755
--- a/formats/format_g723.c
+++ b/formats/format_g723.c
@@ -191,11 +191,15 @@ static int ast_read_callback(void *data)
delay = ntohl(delay);
else
delay = -1;
+#if 0
/* Average out frames <= 50 ms */
if (delay < 50)
s->fr->timelen = 30;
else
s->fr->timelen = delay;
+#else
+ s->fr->timelen = 30;
+#endif
/* Unless there is no delay, we're going to exit out as soon as we
have processed the current frame. */
if (delay > VOFR_FUDGE) {
@@ -271,6 +275,10 @@ static int g723_write(struct ast_filestream *fs, struct ast_frame *f)
fs->orig.tv_sec = now.tv_sec;
fs->orig.tv_usec = now.tv_usec;
}
+ if (f->datalen <= 0) {
+ ast_log(LOG_WARNING, "Short frame ignored (%d bytes long?)\n", f->datalen);
+ return 0;
+ }
if ((res = write(fs->fd, &delay, 4)) != 4) {
ast_log(LOG_WARNING, "Unable to write delay: res=%d (%s)\n", res, strerror(errno));
return -1;