[Asterisk-code-review] audiohook.c: Difference in read/write rates caused continuou... (asterisk[11])
Kevin Harwell
asteriskteam at digium.com
Mon May 18 13:54:54 CDT 2015
Kevin Harwell has posted comments on this change.
Change subject: audiohook.c: Difference in read/write rates caused continuous buffer resets
......................................................................
Patch Set 4:
(1 comment)
https://gerrit.asterisk.org/#/c/462/4/main/audiohook.c
File main/audiohook.c:
Line 767: * An audiohook's internal rate is influenced by compatibility mode. If
: * compatibility is turned "on" then all audiohooks have their sample rate
: * set to that of the audiohook_list internal sample rate. If compatibility
: * is turned "off" then audiohooks are allowed to adjust their internal rate
: * if needed.
: *
: * Since writes can only adjust the rates while compatibility is "on" and
: * reads can only do it while "off" this keeps an audiohook's internal sample
: * rate from potentially being changed on each read/write if the read/write
: * sample rates differ. Swapping the sample rate on each read/write of course
: * causes problems since the factory buffers get reset each time.
: */
> This just adds to my confusion. Write of what? Where? Why off/on?
Do you mean scrap the comment and add a new one or the fix itself?
The current patch was my interpretation of what we had discussed:
"Basically, if they differ, don't overwrite the individual audiohook's internal rate with the list's rate unless compatibility is turned on"
Which is what the audiohook_set_compatible function is doing. It checks to see if compatibility is set on the audiohook_list. If it is, then the audiohook_list's internal sample rate is used for reading/writing from/to the slin factories.
A flag is set on the audiohook itself stating whether or not it is in compatibility mode. If it is then the internal sample rate on the audiohook is not allowed to be changed unless it's changed because the audiohook_list's internal sample rate changed. If compatibility mode is not on then an audiohook's internal sample rate can be changed without regard to compatibility with other audiohooks or the audiohook_list.
--
To view, visit https://gerrit.asterisk.org/462
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Idab4dfef068a7922c09cc631dda27bc920a6c76f
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list