[Asterisk-Dev] PATCH: rtp.c, passing g723.1, infinite loop

Bill Leckey bleckey at tpg.com.au
Wed Oct 29 18:27:19 MST 2003


I've found, when passing g723.1 that occasionally the rtp thread will 
loop forever.

It turns out that the problem is in rtp.c.  If g723_len returns 0, then 
g723_samples will never update pos, its offset variable, and will 
forever check the same position in the buffer.

Attached is the patch.

--- start patch ---

--- rtp.c~      Thu Oct 30 12:20:55 2003
+++ rtp.c       Thu Oct 30 12:21:03 2003
@@ -138,5 +138,5 @@
         while(pos < maxlen) {
                 res = g723_len(buf[pos]);
-               if (res < 0)
+               if (res <= 0)
                         break;
                 samples += 240;


--- end patch---
Bill




More information about the asterisk-dev mailing list