Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1128)

Unified Diff: media/filters/frame_processor.cc

Issue 1240323003: MSE: Update DTS by the same delta as PTS during partial append window trimming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes my self-nit Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/filters/frame_processor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor.cc
diff --git a/media/filters/frame_processor.cc b/media/filters/frame_processor.cc
index 0528ff7c806f25436991c875ce87abcb87b6289c..6c71ea507240c58543e369184f9fd5d721be8d93 100644
--- a/media/filters/frame_processor.cc
+++ b/media/filters/frame_processor.cc
@@ -388,10 +388,11 @@ bool FrameProcessor::HandlePartialAppendWindowTrimming(
append_window_start - buffer->timestamp(), base::TimeDelta()));
// Adjust the timestamp of this buffer forward to |append_window_start| and
- // decrease the duration to compensate.
+ // decrease the duration to compensate. Adjust DTS by the same delta as PTS
+ // to help prevent spurious discontinuities when DTS > PTS.
+ base::TimeDelta pts_delta = append_window_start - buffer->timestamp();
buffer->set_timestamp(append_window_start);
- buffer->SetDecodeTimestamp(
- DecodeTimestamp::FromPresentationTime(append_window_start));
+ buffer->SetDecodeTimestamp(buffer->GetDecodeTimestamp() + pts_delta);
buffer->set_duration(frame_end_timestamp - append_window_start);
processed_buffer = true;
}
« no previous file with comments | « no previous file | media/filters/frame_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698