aboutsummaryrefslogtreecommitdiff
path: root/net/asterisk12/files/patch-formats::format_g729.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/asterisk12/files/patch-formats::format_g729.c')
-rw-r--r--net/asterisk12/files/patch-formats::format_g729.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/net/asterisk12/files/patch-formats::format_g729.c b/net/asterisk12/files/patch-formats::format_g729.c
index 78899a3e5d43..11be5281608f 100644
--- a/net/asterisk12/files/patch-formats::format_g729.c
+++ b/net/asterisk12/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}