Merged revisions 51204 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Wed, 17 Jan 2007 23:31:40 +0000 (23:31 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 17 Jan 2007 23:31:40 +0000 (23:31 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r51204 | russell | 2007-01-17 16:09:52 -0600 (Wed, 17 Jan 2007) | 4 lines

Instead of dividing the offset by 2 directly, make it more clear that the
offset is being scaled by the size of the elements in the buffer.
(Inspired by a discussing on the asterisk-dev list about this code)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51206 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index def6c1a..8b00377 100644 (file)
@@ -5056,7 +5056,7 @@ static struct ast_frame  *zt_read(struct ast_channel *ast)
        p->subs[index].f.samples = READ_SIZE;
        p->subs[index].f.mallocd = 0;
        p->subs[index].f.offset = AST_FRIENDLY_OFFSET;
-       p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET/2;
+       p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET / sizeof(p->subs[index].buffer[0]);
 #if 0
        if (option_debug)
                ast_log(LOG_DEBUG, "Read %d of voice on %s\n", p->subs[index].f.datalen, ast->name);