aboutsummaryrefslogtreecommitdiffstats
path: root/main/frame.c
AgeCommit message (Collapse)AuthorFilesLines
2008-08-22Remove show_frame_stats_deprecated since it is notmmichelson1-17/+0
used anywhere and causes build errors if building under dev-mode with TRACE_FRAMES selected in menuselect. (closes issue #13362) Reported by: snuffy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@139521 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-17Add prototype for ast_dsp_frame_freed. I'm not sure how this wasmmichelson1-0/+1
compiling before... git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114211 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-17It was possible for a reference to a frame which was part of a freed DSP to ↵mmichelson1-0/+3
still be referenced, leading to memory corruption and eventual crashes. This code change ensures that the dsp is freed when we are finished with the frame. This change is very similar to a change Russell made with translators back a month or so ago. (closes issue #11999) Reported by: destiny6628 Patches: 11999.patch uploaded by putnopvut (license 60) Tested by: destiny6628, victoryure git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114207 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-27Put this flag back so we don't change the API.qwell1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@111280 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-26Remove excessive smoother optimization that was causing audio glitches ↵qwell1-17/+1
(small "pops") after (about 200ms later) an "incorrectly" sized frame was received. While it would be very nice to keep this as optimized as possible, it makes no sense for the smoother to be dropping random bits of audio like this. Isn't that the whole point of a smoother? Closes issue #12093. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@111245 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07Safely use the strncat() function.tilghman1-3/+3
(closes issue #11958) Reported by: norman Patches: 20080209__bug11958.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@106552 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-18Revert adding the packed attribute, as it really doesn't make sense why thatrussell1-3/+3
would do any good. Fix the real bug, which is to do the check to see if the frame came from a translator at the beginning of ast_frame_free(), instead of at the end. This ensures that it always gets checked, even if none of the parts of the frame are malloc'd, and also ensures that we aren't looking at free'd memory in the case that it is a malloc'd frame. (closes issue #11792, reported by explidous, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99081 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-17Have IAX2 optimize the codec translation path just like chan_sip does it. Ifrussell1-1/+37
the caller's codec is in our codec list, move it to the top to avoid transcoding. (closes issue #10500) Reported by: stevedavies Patches: iax-prefer-current-codec.patch uploaded by stevedavies (license 184) iax-prefer-current-codec.1.4.patch uploaded by stevedavies (license 184) Tested by: stevedavies, pj, sheldonh git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99004 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-15Commit a fix for some memory access errors pointed out by the valgrind2.txtrussell1-4/+10
output on issue #11698. The issue here is that it is possible for an instance of a translator to get destroyed while the frame allocated as a part of the translator is still being processed. Specifically, this is possible anywhere between a call to ast_read() and ast_frame_free(), which is _a lot_ of places in the code. The reason this happens is that the channel might get masqueraded during this time. During a masquerade, existing translation paths get destroyed. So, this patch fixes the issue in an API and ABI compatible way. (This one is for you, paravoid!) It changes an int in ast_frame to be used as flag bits. The 1 bit is still used to indicate that the frame contains timing information. Also, a second flag has been added to indicate that the frame came from a translator. When a frame with this flag gets released and has this flag, a function is called in translate.c to let it know that this frame is doing being processed. At this point, the flag gets cleared. Also, if the translator was requested to be destroyed while its internal frame still had this flag set, its destruction has been deffered until it finds out that the frame is no longer being processed. Admittedly, this feels like a hack. But, it does fix the issue, and I was not able to think of a better solution ... git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98943 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-11Fix samples vs. length calculations for g722russell1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98082 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-20Put the speex packetization values back in but disable it when setting up ↵file1-1/+1
the smoother. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@70360 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-20Don't do packetization/smoother stuff with speex, it doesn't work.file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@70198 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-19Merge the changes from the /team/group/vldtmf_fixup branch.russell1-5/+3
The main bug being addressed here is a problem introduced when two SIP channels using SIP INFO dtmf have their media directly bridged. So, when a DTMF END frame comes into Asterisk from an incoming INFO message, Asterisk would try to emulate a digit of some length by first sending a DTMF BEGIN frame and sending a DTMF END later timed off of incoming audio. However, since there was no audio coming in, the DTMF_END was never generated. This caused DTMF based features to no longer work. To fix this, the core now knows when a channel doesn't care about DTMF BEGIN frames (such as a SIP channel sending INFO dtmf). If this is the case, then Asterisk will not emulate a digit of some length, and will instead just pass through the single DTMF END event. Channel drivers also now get passed the length of the digit to their digit_end callback. This improves SIP INFO support even further by enabling us to put the real digit duration in the INFO message instead of a hard coded 250ms. Also, for an incoming INFO message, the duration is read from the frame and passed into the core instead of just getting ignored. (issue #8597, maybe others...) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51311 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-04don't mark these allocations as 'cache' allocations when caching has been ↵kpfleming1-2/+4
disabled git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-04don't do frame header caching in the core if LOW_MEMORY is definedkpfleming1-1/+16
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49461 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-28removed <err.h> as in trunk from the ael stuff. Also, threw in a minor fix ↵murf1-1/+1
to frame.c to avoid build-killing compiler warnings. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49020 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27since these variables all have static duration, none of them need ↵kpfleming1-1/+1
initializers (they default to zero anyway) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49006 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27allow 'show memory' and 'show memory summary' to distinguish memory ↵kpfleming1-2/+2
allocations that were done for caching purposes, so they don't look like memory leaks git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48987 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-20Merged revisions 47859 via svnmerge from file1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r47859 | file | 2006-11-20 14:50:21 -0500 (Mon, 20 Nov 2006) | 2 lines Don't forget to byte swap if we are exiting the smoother feed early. (issue #8287 reported by arturs) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47860 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-08the battle over CLI command formats has broken stuff...kpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47338 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Reverse change of "show" to "list" and make several other commands more ↵tilghman1-5/+5
consistent with "category verb arguments" git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47051 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-25add passthrough and file format support for G.722 16KHz audio (issue #5084, ↵kpfleming1-4/+6
original patch by andrew, updated by mithraen) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46154 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-28Put in missing \ns on the end of ast_logs (issue #7936 reported by wojtekka)file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43933 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-26Issue #8015, patch by Dan Austin.qwell1-6/+6
Maximum values were incorrect, which is why this is being put in 1.4 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43674 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-22Suppress a compiler warning about the use of a potentially uninitializedrussell1-1/+1
variable. It couldn't actually happen, though. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43477 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-19Warning be gone!file1-10/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43264 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18allow for packetization on rtp channel drivers, need to addmogorman1-21/+118
option for setting our own packetization as apposed to just doing what is asked. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43243 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18merge qwell's CLI verbification workkpfleming1-14/+145
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-04Remove old unused functionsfile1-85/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41974 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-03Add the ability to specify that a frame should not be considered for cachingrussell1-2/+2
for uses in cases where you *know* that it will do no good. This patch was inspired by file for use in some work of his on mixmonitor/chanspy. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41958 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-31Add new frame types for DTMFfile1-2/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41595 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-29Merge team/russell/frame_cachingrussell1-60/+112
There are some situations in Asterisk where ast_frame and/or iax_frame structures are rapidly allocatted and freed (at least 50 times per second for one call). This code significantly improves the performance of ast_frame_header_new(), ast_frdup(), ast_frfree(), iax_frame_new(), and iax_frame_free() by keeping a thread-local cache of these structures and using frames from the cache whenever possible instead of calling malloc/free every time. This commit also converts the ast_frame and iax_frame structures to use the linked list macros. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41278 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-0/+1369
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b