]> git.ipfire.org Git - thirdparty/asterisk.git/commit
audiohooks: Remove redundant codec translations when using audiohooks 25/4025/4
authorMichael Walton <mike@farsouthnet.com>
Wed, 5 Oct 2016 01:46:17 +0000 (14:46 +1300)
committerJoshua Colp <jcolp@digium.com>
Mon, 10 Oct 2016 16:41:42 +0000 (11:41 -0500)
commit7af7490e420ec09bc60cda12df45abf664edcb34
tree88243f2a063bdaab69f5ea5edc3ad628e45d7e27
parent7126194187f1ddae1a6e7a7f80f5e84bafd6db4b
audiohooks: Remove redundant codec translations when using audiohooks

The main frame read and write handlers in main/channel.c don't use the
optimum placement in the processing flow for calling audiohooks
callbacks, as far as codec translation is concerned. This change places
the audiohooks callback code:
 * After the channel read translation if the frame is not linear before
the translation, thereby increasing the chance that the frame is linear
as required by audiohooks
 * Before the channel write translation if the frame is linear at this
point
This prevents the audiohooks code from instantiating additional
translation paths to/from linear where a linear frame format is already
available, saving valuable CPU cycles

ASTERISK-26419

Change-Id: I6edd5771f0740e758e7eb42558b953f046c01f8f
main/channel.c