39 wrapped_pts = wrapped_pts & (kPtsWrapAround - 1);
41 DCHECK_GE(wrapped_pts, 0);
42 DCHECK_LT(wrapped_pts, kPtsWrapAround);
46 last_wrapped_ = wrapped_pts;
48 DVLOG(3) <<
"PtsUnwrapper: Initialized with PTS " << wrapped_pts;
53 int64_t diff = SignedPtsDiff(wrapped_pts, last_wrapped_);
64 DVLOG(2) <<
"PtsUnwrapper: Detected backward jump from " << last_wrapped_
65 <<
" to " << wrapped_pts <<
" (diff=" << diff <<
")";
72 if (wrapped_pts < last_wrapped_ && diff > 0) {
74 unwrapped_offset_ += kPtsWrapAround;
75 DVLOG(2) <<
"PtsUnwrapper: Detected wrap-around from " << last_wrapped_
76 <<
" to " << wrapped_pts <<
", new offset=" << unwrapped_offset_;
79 last_wrapped_ = wrapped_pts;
80 int64_t unwrapped = wrapped_pts + unwrapped_offset_;
82 DVLOG(3) <<
"PtsUnwrapper: Unwrap(" << wrapped_pts <<
") = " << unwrapped
83 <<
" (offset=" << unwrapped_offset_ <<
")";