From: David Vossel Date: Tue, 14 Apr 2009 15:02:04 +0000 (+0000) Subject: audio_audiohook_write_list() does not correctly update sample size after ast_translate. X-Git-Tag: 1.4.25-rc1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f967bdc670e0642a6210d4925c2a5708296fa802;p=thirdparty%2Fasterisk.git audio_audiohook_write_list() does not correctly update sample size after ast_translate. audio_audiohook_write_list() does not take into account that the sample size may change after translation depending on if the original frame is is 8khz or 16khz. While no 16kz codecs are supported in 1.4 at the moment, this will save headaches in the future if they ever are. the sample size is now updated after translating to reflect this possibility. Thanks to jcolp and mmichelson for helping me work this out. (issue AST-197) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188287 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/audiohook.c b/main/audiohook.c index fdd241db2c..d055a73f19 100644 --- a/main/audiohook.c +++ b/main/audiohook.c @@ -588,6 +588,7 @@ static struct ast_frame *audio_audiohook_write_list(struct ast_channel *chan, st } if (!(middle_frame = ast_translate(in_translate->trans_pvt, frame, 0))) return frame; + samples = middle_frame->samples; } /* Queue up signed linear frame to each spy */