From 55c3bdddb8b700f51a6c10e2b54470dca777c231 Mon Sep 17 00:00:00 2001 From: "lee.fordyce" Date: Tue, 6 Feb 2024 13:18:50 -0700 Subject: [PATCH] fix: PR feedback --- packager/media/formats/mp4/track_run_iterator.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packager/media/formats/mp4/track_run_iterator.cc b/packager/media/formats/mp4/track_run_iterator.cc index e47f50b3bf3..3e9ecd7b05a 100644 --- a/packager/media/formats/mp4/track_run_iterator.cc +++ b/packager/media/formats/mp4/track_run_iterator.cc @@ -463,7 +463,7 @@ void TrackRunIterator::ResetRun() { }); if (min_sample_itr != run_itr_->samples.end() && min_sample_itr->cts_offset < 0) { - min_cts_offset_ = min_sample_itr->cts_offset; + min_cts_offset_ = abs(min_sample_itr->cts_offset); } } @@ -592,13 +592,12 @@ int TrackRunIterator::sample_size() const { int64_t TrackRunIterator::dts() const { DCHECK(IsSampleValid()); - return cts_offset_adjustment_ ? sample_dts_ - abs(min_cts_offset_) - : sample_dts_; + return cts_offset_adjustment_ ? sample_dts_ - min_cts_offset_ : sample_dts_; } int64_t TrackRunIterator::cts() const { DCHECK(IsSampleValid()); - return cts_offset_adjustment_ ? dts() + abs(min_cts_offset_) + return cts_offset_adjustment_ ? dts() + min_cts_offset_ : sample_dts_ + sample_itr_->cts_offset; }