Index: webrtc/base/timestampaligner.cc |
diff --git a/webrtc/base/timestampaligner.cc b/webrtc/base/timestampaligner.cc |
index e03e4fb04eb9ca85a891c580f6335a46be46e8f8..66724399fe6daebdfc7fe118a29210921577bfa0 100644 |
--- a/webrtc/base/timestampaligner.cc |
+++ b/webrtc/base/timestampaligner.cc |
@@ -13,11 +13,16 @@ |
namespace rtc { |
-TimestampAligner::TimestampAligner() : frames_seen_(0), offset_us_(0) {} |
+TimestampAligner::TimestampAligner() : frames_seen_(0), offset_us_(0) { |
+ thread_checker_.DetachFromThread(); |
+} |
+ |
TimestampAligner::~TimestampAligner() {} |
int64_t TimestampAligner::UpdateOffset(int64_t camera_time_us, |
int64_t system_time_us) { |
+ RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
// Estimate the offset between system monotonic time and the capture |
// time from the camera. The camera is assumed to provide more |
// accurate timestamps than we get from the system time. But the |
@@ -86,6 +91,8 @@ int64_t TimestampAligner::UpdateOffset(int64_t camera_time_us, |
int64_t TimestampAligner::ClipTimestamp(int64_t time_us, |
int64_t system_time_us) { |
+ RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
// Make timestamps monotonic. |
if (!prev_translated_time_us_) { |
// Initialize. |