[asterisk-dev] [Code Review] 3713: media_formats: Correct issues caused by r3689 (the great rename)

Matt Jordan reviewboard at asterisk.org
Sat Jul 5 11:01:10 CDT 2014



> On July 5, 2014, 9:04 a.m., Matt Jordan wrote:
> > /team/group/media_formats-reviewed-trunk/main/format_cap.c, lines 160-164
> > <https://reviewboard.asterisk.org/r/3713/diff/1/?file=62293#file62293line160>
> >
> >     Hm. I thought we got rid of this on purpose, since the ao2_alloc_options of the framed object already provides it a ref count of 1.
> >     
> >     Who decrements the allocation reference?
> 
> Corey Farrell wrote:
>     We did remove it by mistake.  After format_cap_framed_init we need framed to have 2 references.  The one we add here belongs to the cap->formats list, the other (from ao2_alloc) belongs to cap->preference_order.
>     
>     These two references are removed when the format is removed from the cap.  See format_cap_destroy or ast_format_cap_remove for example, the frame is decremented when removed from the cap->formats and cap->preference_order.  This without this reference I'm adding back in we get a frack for every format added to a cap.

Works for me - thanks for fixing it :-)


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3713/#review12494
-----------------------------------------------------------


On July 4, 2014, 3:49 p.m., Corey Farrell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3713/
> -----------------------------------------------------------
> 
> (Updated July 4, 2014, 3:49 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> I missed a couple issues on r3689:
> * chan_mgcp: buf unused variable prevents devmode build
> * chan_skinny / chan_unistim: tech.capabilities double ao2_cleanup
> * format_cap: ao2_ref(framed, +1) was mistakenly removed, causing many fracks
> 
> In the case of format_cap, I didn't notice that it was being added to a cap->formats and caps->preference_order.
> 
> 
> Diffs
> -----
> 
>   /team/group/media_formats-reviewed-trunk/main/format_cap.c 418064 
>   /team/group/media_formats-reviewed-trunk/channels/chan_unistim.c 418064 
>   /team/group/media_formats-reviewed-trunk/channels/chan_skinny.c 418064 
>   /team/group/media_formats-reviewed-trunk/channels/chan_mgcp.c 418064 
> 
> Diff: https://reviewboard.asterisk.org/r/3713/diff/
> 
> 
> Testing
> -------
> 
> Compile, run, shutdown gracefully with no fracks.
> 
> 
> Thanks,
> 
> Corey Farrell
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140705/baeec47b/attachment.html>


More information about the asterisk-dev mailing list