Changeset 2583


Ignore:
Timestamp:
Apr 7, 2009 11:16:24 PM (10 years ago)
Author:
nanang
Message:

Ticket #762: Fixed jbuf in handling far sequence jump (the distance is over jbuf capacity) while jbuf is empty.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/jbuf.c

    r2578 r2583  
    336336    } 
    337337 
    338     /* too soon or jump too far */ 
     338    /* get distance of this frame to the first frame in the buffer */ 
    339339    distance = index - framelist->origin; 
     340 
     341    /* far jump, the distance is greater than buffer capacity */ 
    340342    if (distance >= (int)framelist->max_count) { 
    341343        if (distance > MAX_DROPOUT) { 
    342             /* jump too far */ 
     344            /* jump too far, reset the buffer */ 
    343345            jb_framelist_reset(framelist); 
    344346            framelist->origin = index; 
    345347            distance = 0; 
    346348        } else { 
    347             /* too soon, buffer is not enough */ 
    348             return PJ_ETOOMANY; 
     349            if (framelist->size == 0) { 
     350                /* if jbuf is empty, process the frame */ 
     351                framelist->origin = index; 
     352                distance = 0; 
     353            } else { 
     354                /* otherwise, reject the frame */ 
     355                return PJ_ETOOMANY; 
     356            } 
    349357        } 
    350358    } 
Note: See TracChangeset for help on using the changeset viewer.