Index: webrtc/system_wrappers/source/timestamp_extrapolator.cc |
diff --git a/webrtc/system_wrappers/source/timestamp_extrapolator.cc b/webrtc/system_wrappers/source/timestamp_extrapolator.cc |
index c7ed856a54742222434e898780d46393981dbbb1..b030799b1a96a0eed9386edd557d49fb61993326 100644 |
--- a/webrtc/system_wrappers/source/timestamp_extrapolator.cc |
+++ b/webrtc/system_wrappers/source/timestamp_extrapolator.cc |
@@ -77,15 +77,26 @@ TimestampExtrapolator::Update(int64_t tMs, uint32_t ts90khz) |
_prevMs = tMs; |
} |
- // Remove offset to prevent badly scaled matrices |
- tMs -= _startMs; |
- |
CheckForWrapArounds(ts90khz); |
int64_t unwrapped_ts90khz = static_cast<int64_t>(ts90khz) + |
_wrapArounds * ((static_cast<int64_t>(1) << 32) - 1); |
if (_prevUnwrappedTimestamp >= 0 && |
+ std::abs(unwrapped_ts90khz - _prevUnwrappedTimestamp) > |
+ 90 * 1000 * 10) |
nisse-webrtc
2017/03/30 06:37:07
This limit deserves a symbolic name.
And I think
stefan-webrtc
2017/03/30 06:55:14
I think this will trigger cases where we may not w
qiangchen
2017/03/30 17:47:38
That's a good idea, and I do see the following cod
|
+ { |
+ // Time stamp jump more than 10s. |
+ // We took this as a sign of a different stream, reset the extrapolator. |
+ _rwLock->ReleaseLockExclusive(); |
+ Reset(tMs); |
+ _rwLock->AcquireLockExclusive(); |
+ } |
+ |
+ // Remove offset to prevent badly scaled matrices |
+ tMs -= _startMs; |
+ |
+ if (_prevUnwrappedTimestamp >= 0 && |
unwrapped_ts90khz < _prevUnwrappedTimestamp) |
{ |
// Drop reordered frames. |