If buffering is disalbed (packetBufferBehavior(-1)) the unfilteredAddPkt() method does not increase the lenght of the buffer so the method popFrameQueueCleanup does the wrong cleanup.
The unfilteredAddPkt() method also adds the packet at the wrong end of the queue.
My Solution:
private int unfilteredAddPkt(PktBufNode newNode) {
if(RTPSession.rtpDebugLevel > 8) {
System.out.println("<->PktBuffer.unfilteredAddPkt()");
}
//No magic, just add to the end
if(oldest != null) {
newNode.nextFrameQueueNode = newest;
newest.prevFrameQueueNode = newNode;
newest = newNode;
} else {
oldest = newNode;
newest = newNode;
}
length++;
return 0;
}