[Asterisk-Dev] what might corrupt...? (fixed, but have a question)

Goldfinger, Todd A goldfita at rose-hulman.edu
Tue Jan 3 09:08:18 MST 2006


-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com on behalf of Tilghman Lesher
Sent: Fri 12/23/2005 1:26 PM
To: Asterisk Developers Mailing List
Subject: Re: [Asterisk-Dev] what might corrupt ulaw_encoder_pvt tail?
 
On Friday 23 December 2005 11:51, Goldfinger, Todd A wrote:
> I've written a short application to insert one linear pcm file into
> another.  It appears to work, but occasionally asterisk dies without
> warning when I later run ast_streamfile from a different application.
>  Whether asterisk crashes or not, the new file appears to be correct.
>  It's still 8k, 16bit.  I can open and listen to it.
>
> Sometimes, I get the following just before it dies.
>
> codec_ulaw.c:236 lintoulaw_framein: Out of buffer space
>
> I changed the warning to
>
> ast_log (LOG_WARNING, "Out of buffer space %d %d
> %d\n",tmp->tail,f->datalen/2,sizeof(tmp->outbuf));
>
> And I got this.
>
> codec_ulaw.c:236 lintoulaw_framein: Out of buffer space -262144 160
> 8096
>
> I don't understand why the if statement on line 234 would even
> execute.  But in any case, it seems tail is corrupted.  Does anyone
> know what might cause this?  I'm not sure where to go from here.

You have queued a frame with a negative datalen.  That gets processed,
and in so doing, corrupts tail.  You aren't seeing it in this debug,
because it was a previous frame, not the current one.

-- 
Tilghman
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev





My problem appears to be fixed.  Usually I call ast_openstream followed by ast_streamfile and then ast_stopstream.  In this case, I was not calling ast_streamfile because I only needed the length.  I noticed that ast_streamfile calls ast_applystream.  So, I put ast_applystream in after openstream and this seems to work.

I couldn't find an explanation in the code, on the wiki, or in the developer lists.  So my question is what is applystream needed for, and when should I be calling it?

thanks again
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4195 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20060103/d7076714/attachment.bin


More information about the asterisk-dev mailing list