[Asterisk-code-review] func_frame_drop: New function (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Tue Jul 6 08:34:43 CDT 2021
Attention is currently required from: N A.
Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16071 )
Change subject: func_frame_drop: New function
......................................................................
Patch Set 9:
(1 comment)
File funcs/func_frame_drop.c:
https://gerrit.asterisk.org/c/asterisk/+/16071/comment/d2ebd87a_f99ae9a8
PS9, Line 196: if (drop_frame) {
> It says that frames should only be freed on reads, not writes there, isn't that what I'm doing here, […]
You aren't reading frames. You have a framehook which is invoked when a frame is written to the channel, or read from the channel, as determined by the event variable (AST_FRAMEHOOK_EVENT_READ, AST_FRAMEHOOK_EVENT_WRITE). If AST_FRAMEHOOK_EVENT_WRITE then, at least for voice (I haven't tested others), you can't free the frame as it can cause a double free and a crash. Testing it would likely be best with Asterisk running on valgrind running through various types. Examining the code in channel.c to look at the lifetime of the frame would also be good. HOLD_INTERCEPT may also be impacted, yes.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16071
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8147c9d55d74e2e48861edba6b22f930920541ec
Gerrit-Change-Number: 16071
Gerrit-PatchSet: 9
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Comment-Date: Tue, 06 Jul 2021 13:34:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210706/beff86a4/attachment.html>
More information about the asterisk-code-review
mailing list