Hi, The segmentation fault is perhaps a different problem, since the frame PJMEDIA_FRAME_TYPE_AUDIO returned by get_frame() of stream should contain *valid* audio data, i.e: generated by PLC and/or zero fill, so it shouldn't cause segmentation fault. Regarding querying jitter buffer state from outside of stream, perhaps the only way is by hacking the stream :D , e.g: adding new API to get jbuf state. Regards, nanang On Mon, Mar 2, 2009 at 8:41 PM, manjeet <manjeetss1 at yahoo.com> wrote: > Hi Nanang, > > Thanks for your reply. > > The issue is due to this problem, i get a segmentation fault, becuase i do a > pjmedia_port_get_frame() and then call pjmedia_port_put_frame(), as the > frame is empty so put_frame seg faults. > > Actually i dont want to do get_frames, until i am sure that jitter buffer is > not empty. With existing problem in the code, pjmedia_port_get_frame() > returns 'PJ_SUCCESS' and ''PJMEDIA_FRAME_TYPE_AUDIO', so there is no way for > me to know whether the call has failed or not, so that i dont call > put_frame() in case the call has failed. > > Is there any other work around, i tried using pjmedia_jbuf_get_state() > before calling get_frame(), but as Pjmedia_stream is defined in the stream.c > only, its giving me problems. > > Please let me know in case you have any idea to overcome this issue? > > Thanks n regards, > Manjeet > > > > --- On Mon, 3/2/09, Nanang Izzuddin <nanang at pjsip.org> wrote: > > From: Nanang Izzuddin <nanang@xxxxxxxxx> > Subject: Re: Probable Bug in get_frame() in Stream.c, when jitter > buffer is empty > To: "pjsip list" <pjsip at lists.pjsip.org> > Date: Monday, March 2, 2009, 6:48 PM > > Hi, > > I guess you're right, stream.c always returns > PJMEDIA_FRAME_TYPE_AUDIO, however it should be fine since stream > invokes PLC and/or zero-fill when jitter buffer returning non-normal > frame. It just seems that the samples_count check is useless there. > > Regards, > nanang > > > On Mon, Mar 2, 2009 at 1:28 PM, manjeet <manjeetss1 at yahoo.com> wrote: >> Hi, >> >> Could somebody please reply, in case he/she has faced the similar > issue? >> >> Regards, >> Manjeet >> >> >> >> --- On Sat, 2/28/09, manjeet <manjeetss1 at yahoo.com> wrote: >> >> From: manjeet <manjeetss1@xxxxxxxxx> >> Subject: Probably issue in get_frame() in Stream.c, when jitter >> buffer is empty >> To: pjsip at lists.pjsip.org >> Date: Saturday, February 28, 2009, 7:09 PM >> >> Hi All, >> >> I am facing issues when i call pjmedia_port_get_frame() and there are no >> frames in the jitter buffer. >> >> I am using streams (so get_frame() from stream.c gets called), and i get > the >> following error :- strm0x81052ac? Jitter buffer empty (prefetch=0), that >> seems to be OK. >> >> But the issue is the "frame->type" returned is always >> "PJMEDIA_FRAME_TYPE_AUDIO", instead of > "PJMEDIA_FRAME_TYPE_NONE". >> >> I looked at the get_frame() code in stream.c file, > and i think the code > has >> a BUG in case the frame->type is > "PJMEDIA_JB_ZERO_EMPTY_FRAME", as >> 'samples_count' will never be 0, on the basis of which we assign > the value >> to 'frame->type' at the end of get_frame() callback. >> >> Did anybody else also faced the similar problem or could somebody pl help? >> >> Thanks n regards, >> Manjeet >> >> >> _______________________________________________ >> 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 >> >> >> _______________________________________________ >> 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 >> >> > > _______________________________________________ > 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 > >