]> git.ipfire.org Git - thirdparty/asterisk.git/commit
audiohook.c: Difference in read/write rates caused continuous buffer resets 63/463/6
authorKevin Harwell <kharwell@digium.com>
Thu, 14 May 2015 20:21:23 +0000 (15:21 -0500)
committerKevin Harwell <kharwell@digium.com>
Wed, 20 May 2015 21:08:58 +0000 (16:08 -0500)
commitb1e8c0b9eb7807f8f0368e06e99f31937a04df70
tree7fc22cbb354d5361a3b850d502ef199c27bd7eb7
parent8697a49ef93dc1356731821c073b78d5f1dc90cb
audiohook.c: Difference in read/write rates caused continuous buffer resets

Currently, everytime a sample rate change occurs (on read or write) the
associated factory buffers are reset. If the requested sample rate on a
read differed from that of a write then the buffers are continually reset
on every read and write. This has the side effect of emptying the buffer,
thus there being no data to read and then write to a file in the case of
call recording.

This patch fixes it so that an audiohook_list's rate always maintains the
maximum sample rate among hooks and formats. Audiohook sample rates are
only overwritten by this value when slin native compatibility is turned on.
Also, the audiohook sample rate can only overwrite the list's sample rate
when its rate is greater than that of the list or if compatibility is
turned off. This keeps the rate from constantly switching/resetting.

ASTERISK-24944 #close
Reported by: Ronald Raikes

Change-Id: Idab4dfef068a7922c09cc631dda27bc920a6c76f
include/asterisk/audiohook.h
main/audiohook.c