rtp_engine.c: Fix performance issue with several channel drivers that use RTP.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 29 Jul 2015 18:49:47 +0000 (13:49 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 30 Jul 2015 22:11:58 +0000 (17:11 -0500)
commitf49bef08a2a57f87043bb3af7525fbabcb428450
tree66c6595108b0ce7a1d4b7547c1451022c9abd380
parent33a465249b4688b83684e182c4bb26c6fcd7d2a3
rtp_engine.c: Fix performance issue with several channel drivers that use RTP.

ast_rtp_codecs_get_payload() gets called once or twice for every received
RTP frame so it would be nice to not allocate an ao2 object to then have
it destroyed shortly thereafter.  The ao2 object gets allocated only if
the payload type is not set by the channel driver as a negotiated value.
The issue affects chan_skinny, chan_unistim, chan_rtp, and chan_ooh323.

* Made static_RTP_PT[] an array of ao2 objects that
ast_rtp_codecs_get_payload() can return instead of an array of structs
that must be copied into a created ao2 object.

ASTERISK-25296 #close
Reported by: Richard Mudgett

Change-Id: Icb6de5cd90bfae07d44403a1352963db9109dac0
main/rtp_engine.c