thread = new Thread(new Runnable() {
@Override
public void run() {
while (running) {
try {
DecodeUnit decodeUnit = depacketizer.takeNextDecodeUnit();
long latency = System.currentTimeMillis()-decodeUnit.getReceiveTimestamp();
endToEndLatency += latency;
dataSize += decodeUnit.getDataLength();
decodeUnit(decodeUnit);
latency = System.currentTimeMillis()-decodeUnit.getReceiveTimestamp();
decodeLatency += latency;
if (latency>maxLatency)
maxLatency = latency;