aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-01 18:48:05 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-01 18:48:05 +0000
commit911461e2db8651d93f791a052e14eaf7e2258193 (patch)
tree6a822269f0bf5c01af62a8fc1d0a5686a0c55c27 /channel.c
parentcd7ee5f7cd6d49a4ed351fa7df55c2ca3289de89 (diff)
use a writeable frame (some channel drivers/transcoders may modify the frame after it has been passed to ast_write())
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6926 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/channel.c b/channel.c
index 6c2566ffe..b67dc707a 100755
--- a/channel.c
+++ b/channel.c
@@ -3933,19 +3933,19 @@ static void silence_generator_release(struct ast_channel *chan, void *data)
/* nothing to do */
}
-static short normal_silence_buf[160] = { 0, };
-static struct ast_frame normal_silence_frame = {
- .frametype = AST_FRAME_VOICE,
- .subclass = AST_FORMAT_SLINEAR,
- .data = normal_silence_buf,
- .samples = 160,
- .datalen = sizeof(normal_silence_buf),
-};
-
static int silence_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
{
if (samples == 160) {
- if (ast_write(chan, &normal_silence_frame))
+ short buf[160] = { 0, };
+ struct ast_frame frame = {
+ .frametype = AST_FRAME_VOICE,
+ .subclass = AST_FORMAT_SLINEAR,
+ .data = buf,
+ .samples = 160,
+ .datalen = sizeof(buf),
+ };
+
+ if (ast_write(chan, &frame))
return -1;
} else {
short buf[samples];
@@ -3953,7 +3953,7 @@ static int silence_generator_generate(struct ast_channel *chan, void *data, int
struct ast_frame frame = {
.frametype = AST_FRAME_VOICE,
.subclass = AST_FORMAT_SLINEAR,
- .data = normal_silence_buf,
+ .data = buf,
.samples = samples,
.datalen = sizeof(buf),
};