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

Unified Diff: media/filters/frame_processor.cc

Issue 294393002: MSE: Allow fully discarding frames with resulting timestamps below 0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix PS4 nit (FullDiscard -> P) Created 6 years, 7 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 234552b693d2a259517b301e55e9759c6efbd9dd..93b176e9ae72e8e084e48648ab3d40c24065935b 100644
--- a/media/filters/frame_processor.cc
+++ b/media/filters/frame_processor.cc
@@ -238,19 +238,6 @@ bool FrameProcessor::ProcessFrame(
}
}
- // 8. If the presentation timestamp or decode timestamp is less than the
- // presentation start time, then run the end of stream algorithm with the
- // error parameter set to "decode", and abort these steps.
- if (presentation_timestamp < base::TimeDelta() ||
- decode_timestamp < base::TimeDelta()) {
- DVLOG(2) << __FUNCTION__
- << ": frame PTS=" << presentation_timestamp.InSecondsF()
- << " or DTS=" << decode_timestamp.InSecondsF()
- << " negative after applying timestampOffset and handling any "
- << " discontinuity";
- return false;
- }
-
// 9. Let frame end timestamp equal the sum of presentation timestamp and
// frame duration.
const base::TimeDelta frame_end_timestamp =
@@ -300,6 +287,24 @@ bool FrameProcessor::ProcessFrame(
return true;
}
+ // Note: This step is relocated, versus April 1 spec, to allow append window
+ // processing to first filter coded frames shifted by |timestamp_offset_| in
+ // such a way that their PTS is negative.
+ // 8. If the presentation timestamp or decode timestamp is less than the
+ // presentation start time, then run the end of stream algorithm with the
+ // error parameter set to "decode", and abort these steps.
+ DCHECK(presentation_timestamp >= base::TimeDelta());
+ if (decode_timestamp < base::TimeDelta()) {
+ // B-frames may still result in negative DTS here after being shifted by
+ // |timestamp_offset_|.
+ DVLOG(2) << __FUNCTION__
+ << ": frame PTS=" << presentation_timestamp.InSecondsF()
+ << " has negative DTS=" << decode_timestamp.InSecondsF()
+ << " after applying timestampOffset, handling any discontinuity,"
+ << " and filtering against append window";
+ return false;
+ }
+
// 12. If the need random access point flag on track buffer equals true,
// then run the following steps:
if (track_buffer->needs_random_access_point()) {
@@ -351,9 +356,9 @@ bool FrameProcessor::ProcessFrame(
// 22. If frame end timestamp is greater than group end timestamp, then set
// group end timestamp equal to frame end timestamp.
- DCHECK(group_end_timestamp_ >= base::TimeDelta());
if (frame_end_timestamp > group_end_timestamp_)
group_end_timestamp_ = frame_end_timestamp;
+ DCHECK(group_end_timestamp_ >= base::TimeDelta());
return 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