From 7bf88eb60db0be8543ba3a565c26780dc78dccb8 Mon Sep 17 00:00:00 2001 From: Kevin Harwell Date: Thu, 14 May 2015 15:21:30 -0500 Subject: 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 | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asterisk/audiohook.h b/include/asterisk/audiohook.h index 375b2dd9d..cae8cc071 100644 --- a/include/asterisk/audiohook.h +++ b/include/asterisk/audiohook.h @@ -63,6 +63,7 @@ enum ast_audiohook_flags { AST_AUDIOHOOK_SMALL_QUEUE = (1 << 4), AST_AUDIOHOOK_MUTE_READ = (1 << 5), /*!< audiohook should be mute frames read */ AST_AUDIOHOOK_MUTE_WRITE = (1 << 6), /*!< audiohook should be mute frames written */ + AST_AUDIOHOOK_COMPATIBLE = (1 << 7), /*!< is the audiohook native slin compatible */ }; enum ast_audiohook_init_flags { -- cgit v1.2.3