[Asterisk-Dev] Use of ast_codec_get_samples inside ast_rtp_raw_write on rtp.c, line 1190

Carlos Antunes cmantunes at gmail.com
Tue Oct 4 19:51:36 MST 2005


Hi!

Sifting through the code, once more, I've found something that confuses me.

Each frame struct contains both a datalen and samples fields. However,
inside ast_rtp_raw_write on rtp.c (line 1190), we have

pred = rtp->lastts + ast_codec_get_samples(f)

Now, wouldn't it be easier and faster to simply have

pred = rtp->lastts + f->samples?

Or am I missing something? The thing with ast_codec_get_samples is that is
is somewhat computationally expensive when dealing with highly compressed
codecs like speex, for example. It would be nice to be able to avoid it on a
function that is being used all the time, namely, ast_rtp_raw_write.

Thanks!

Carlos

--
"We hold [...] that all men are created equal; that they are
endowed [...] with certain inalienable rights; that among
these are life, liberty, and the pursuit of happiness"
-- Thomas Jefferson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20051004/a6707c77/attachment.htm


More information about the asterisk-dev mailing list