From: Russell Bryant Date: Wed, 17 Jan 2007 22:09:52 +0000 (+0000) Subject: Instead of dividing the offset by 2 directly, make it more clear that the X-Git-Tag: 1.4.1~262 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b2f8d22f75504f7eef4e0631f0c141300e896c0;p=thirdparty%2Fasterisk.git 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/branches/1.4@51204 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 0208f54f09..c2fad91d7a 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -4774,7 +4774,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 ast_log(LOG_DEBUG, "Read %d of voice on %s\n", p->subs[index].f.datalen, ast->name); #endif