41 wrapped_pts = wrapped_pts & (kPtsWrapAround - 1);
43 DCHECK_GE(wrapped_pts, 0);
44 DCHECK_LT(wrapped_pts, kPtsWrapAround);
48 last_wrapped_ = wrapped_pts;
50 DVLOG(3) <<
"PtsUnwrapper: Initialized with PTS " << wrapped_pts;
55 int64_t diff = SignedPtsDiff(wrapped_pts, last_wrapped_);
66 DVLOG(2) <<
"PtsUnwrapper: Detected backward jump from " << last_wrapped_
67 <<
" to " << wrapped_pts <<
" (diff=" << diff <<
")";
74 if (wrapped_pts < last_wrapped_ && diff > 0) {
76 unwrapped_offset_ += kPtsWrapAround;
77 DVLOG(2) <<
"PtsUnwrapper: Detected wrap-around from " << last_wrapped_
78 <<
" to " << wrapped_pts <<
", new offset=" << unwrapped_offset_;
81 last_wrapped_ = wrapped_pts;
82 int64_t unwrapped = wrapped_pts + unwrapped_offset_;
84 DVLOG(3) <<
"PtsUnwrapper: Unwrap(" << wrapped_pts <<
") = " << unwrapped
85 <<
" (offset=" << unwrapped_offset_ <<
")";