Not enough buffer for SDES packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 
I think I found why the assertion failed.
The problem is about that I set attr->info.max_bps to the rounded-up 2489.
In stream.c, create_channel() is called to create dec & enc channel. When it
comes to line 1402 which is in create_channel() of stream.c, 

channel->out_pkt_size = sizeof(pjmedia_rtp_hdr) + 
  stream->codec_param.info.max_bps * 
  PJMEDIA_MAX_FRAME_DURATION_MS / 
  8 / 1000;

channel->out_pkt_size will be 74 because max_bps is only 2489.
So when appending SDES at line 1333 of stream.c,

len = create_rtcp_sdes(stream, (pj_uint8_t*)pkt, 
  stream->enc->out_pkt_size - len);

We see out_pkt_size - len = 74 - 52 = 22 < 28. So the assertion failed.

My solution is either to increase the max_bps to 3000 or to redefine the
PJMEDIA_MAX_FRAME_DURATION_MS to 300.

Well, streamutil.c uses the pjmedia stream in a different way. When
pjmedia_rtcp_build_rtcp () is call, RTCP RR is always built and no SR, so
the returned variable "len" is always 32(sizeof(pjmedia_rtcp_rr_pkt)), not
52(sizeof(pjmedia_rtcp_sr_pkt)). Finally out_pkt_size = 74 - 32 = 42 > 28.
The assertion won't fail.

I attached my melp.c, melp.h, and the melp implement code if you need it. I
didn't do many tests so sorry for any bug.
For now, the implement uses float point. There is fixed point version but
the performance is really bad.

Thank you again for giving me help!
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: melp.h
Url: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080906/6ac23f31/attachment-0001.h 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: melp.c
Url: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080906/6ac23f31/attachment-0001.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libmelp.zip
Type: application/octet-stream
Size: 77576 bytes
Desc: not available
Url : http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080906/6ac23f31/attachment-0001.zip 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux