- # Don't insert the first chunk into the averaging as it is
- # not complete probably.
- if self.last_samplenum is None or self.chunks < 2:
- # Report the timing normalized.
- self.put(self.last_samplenum, self.samplenum, self.out_ann,
- [0, [normalize_time(t)]])
- else:
- if t > 0:
- self.last_n.append(t)
+ self.put(self.last_samplenum, self.samplenum, self.out_ann,
+ [0, [normalize_time(t)]])
+ if self.options['avg_period'] > 0:
+ self.put(self.last_samplenum, self.samplenum, self.out_ann,
+ [1, [normalize_time(sum(self.last_n) / len(self.last_n))]])
+ if self.last_t and self.options['delta'] == 'yes':
+ self.put(self.last_samplenum, self.samplenum, self.out_ann,
+ [2, [normalize_time(t - self.last_t)]])