[pjsip] Segmentation fault in resample_port.c

Benny Prijono bennylp at pjsip.org
Tue May 13 11:17:06 EDT 2008

On Tue, May 13, 2008 at 12:57 PM, Mathieu Monney <zittix_all at xwaves.net> wrote:
> Hi,
>  I'm trying to develop a gstreamer audio back-end for PJSIP but I get a
>  seg fault in the resampling stuffs When I use the rec/play examples my
>  audio driver works just fine but when I'm using pjsua it seg fault.

Yep. The rec/play samples don't use resample.

>  I'm using PJSIP release 0.8.0. The seg fault comes from the fact that in
>  the resampling port the frame size in byte is equal to twice the frame
>  size in my audio driver.
>  In the resample_get_frame() function in file resample_port.c at line 177
>  the size is equal to 320 (for my case). In my audio driver I compute the
>  frame size as following:
>  samples_per_frame*(bits_per_sample>>3)*channel_count
>  which gives half the value above. But my computation seems correct. Is a
>  bug or am I missing something ?

Well which one is correct is indeed the question. Are you working with
non-mono audio?

In version 0.8 and older, the convention about samples_per_frame value
was not clear when channel_count is non-mono. That is, say if the
audio is stereo, does the samples_per_frame value represent the
combined/2-channels frame length, or does it only represent the size
of the mono frame. If I recall correctly some objects in pjmedia used
different convention hence probably what you saw.

The convention that has been established now (in SVN version) is the
samples_per_frame represents the total length of the frame, that is
it's equal to mono_count*channel_count (Nanang can correct me if I'm
wrong). So because of this you may be better working with the SVN
version instead.


>  Thank you.
>  Mathieu
>  _______________________________________________
>  Visit our blog: http://blog.pjsip.org
>  pjsip mailing list
>  pjsip at lists.pjsip.org
>  http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

More information about the pjsip mailing list