PATCH to repair invalid silence packets generation (not enough payload data)

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

 



Hello all,

Someone mentioned me that I didn't post the the fix yet... my fault  :)

Original problem sent by me:
Title: PJMedia sends for G.711-40ms payload of 80 bytes silence packets
instead of 320 bytes
Link:  click<http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2011-March/012734.html>

Short description of problem:
We detected that when G.711-40ms payload was used, the generated silence
packets did contain 240 bytes of payload instead the expected 320 bytes. As
a result the opposite party can hear distorted audio.
It turned out that there was an error in the silence_frame.size calculation.

Solution (based upon PJSIP 1.5.5)
---------------------------------
File:     pjmedia\src\stream.c
Function: put_frame_imp(?)
Line:     978  (or line 1235 in latest 1.x)

Code delta (release 1.5.5, but code in latest 1.x is equal):
    pj_bzero(&silence_frame, sizeof(silence_frame));
    silence_frame.buf = zero_frame;
    silence_frame.size = stream->codec_param.info.frm_ptime * 2 *
+++                      stream->codec_param.setting.frm_per_pkt *
                         stream->codec_param.info.channel_cnt *
                         stream->codec_param.info.clock_rate / 1000;
    silence_frame.type = PJMEDIA_FRAME_TYPE_AUDIO;
    silence_frame.timestamp.u32.lo = pj_ntohl(stream->enc->rtp.out_hdr.ts);


With regards,

Eize Slange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110823/f039e524/attachment.html>


[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