From: Andre Date: Thu, 15 Jun 2006 12:21:02 +0000 (+0200) Subject: update to libortp-0.10.0 X-Git-Tag: v0.2.14~60^2~19 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=bf2d3cc6a7364067ce9386e4ab63353ca058510a update to libortp-0.10.0 Actually, this version of libortp seems to have a bug which causes the ortp receiver to segfault. Fix seems to be simple and is already sent out to the linphone mailing list. Moreover, Simon made msg_to_buf() static ;( An easy solution to this problem is to provide an own version in ortp_recv.c. --- diff --git a/NEWS b/NEWS index dd02a36a..9750b12d 100644 --- a/NEWS +++ b/NEWS @@ -9,15 +9,16 @@ A bunch of new features and core changes. - the new paraslash scheduler, short and sweet. - Support for m4a files via the new aac filter/ and audio - format handler. (requires libfaad) + format handler (requires libfaad). + - each writer has its own command line parser, just like + para_recv and para_filter. - new writer: osxplay (thanks to Gerd Becker) + - para_client and para_audioc use the error subsystem - writers are integrated in para_audiod - para_client is integrated in para_audiod - - each writer of para_write has its own command line parser, - just like para_recv and para_filter. - random/playlist selector: improved info strings - new audiod commands: tasks, kill - - para_client/para_audioc use the error subsystem + - update to libortp-0.10.0 ------------------------------------------ diff --git a/ortp_recv.c b/ortp_recv.c index d9b26098..12a990c3 100644 --- a/ortp_recv.c +++ b/ortp_recv.c @@ -32,8 +32,6 @@ #define CHUNK_SIZE 128 * 1024 -extern int msg_to_buf(mblk_t *, char *, int); - /** * data specific to the ortp receiver * @@ -67,6 +65,37 @@ uint32_t timestamp; uint32_t chunk_ts; }; + +static int msg_to_buf(mblk_t *mp, char *buffer, int len) +{ + int rlen = len; + mblk_t *m, *mprev; + int mlen; + + m = mp->b_cont; + mprev = mp; + while (m != NULL) { + mlen = (int) (m->b_wptr - m->b_rptr); + if (mlen <= rlen) { + mblk_t *consumed = m; + memcpy (buffer, m->b_rptr, mlen); + /* go to next mblk_t */ + mprev->b_cont = m->b_cont; + m = m->b_cont; + consumed->b_cont = NULL; + freeb (consumed); + buffer += mlen; + rlen -= mlen; + } else { /*if mlen>rlen */ + memcpy (buffer, m->b_rptr, rlen); + m->b_rptr += rlen; + return len; + } + } + return len - rlen; +} + + static void ortp_recv_pre_select(struct sched *s, struct task *t) { struct receiver_node *rn = t->private_data;