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

Unified Diff: media/filters/legacy_frame_processor.cc

Issue 205703003: MSE: Use frame duration, if available, in LegacyFrameProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: media/filters/legacy_frame_processor.cc
diff --git a/media/filters/legacy_frame_processor.cc b/media/filters/legacy_frame_processor.cc
index f7b0547f586e85d69ec6cc96461eba4c1459e83f..ba4cce142ae31e9fc1966d7346abd89700d79de9 100644
--- a/media/filters/legacy_frame_processor.cc
+++ b/media/filters/legacy_frame_processor.cc
@@ -164,10 +164,17 @@ void LegacyFrameProcessor::FilterWithAppendWindow(
// because we can only resume decoding at keyframes.
base::TimeDelta presentation_timestamp = (*itr)->timestamp();
- // TODO(acolwell): Change |frame_end_timestamp| value to
+ // TODO(acolwell): Change |frame_end_timestamp| value to always be
// |presentation_timestamp + (*itr)->duration()|, like the spec
// requires, once frame durations are actually present in all buffers.
+ // See http://crbug.com/351166.
base::TimeDelta frame_end_timestamp = presentation_timestamp;
+ base::TimeDelta frame_duration = (*itr)->duration();
+ if (frame_duration > base::TimeDelta()) {
+ DCHECK(frame_duration != kNoTimestamp());
+ frame_end_timestamp += frame_duration;
+ }
+
if (presentation_timestamp < append_window_start ||
frame_end_timestamp > append_window_end) {
DVLOG(1) << "Dropping buffer outside append window."
@@ -206,7 +213,14 @@ bool LegacyFrameProcessor::AppendAndUpdateDuration(
if (!stream || !stream->Append(buffers))
return false;
- increase_duration_cb_.Run(buffers.back()->timestamp(), stream);
+ // Approximate spec's "highest presentation end timestamp".
+ // TODO(wolenetz, acolwell): Directly calculate this value from buffers in
acolwell GONE FROM CHROMIUM 2014/03/21 15:50:15 nit: Should this TODO really be here. This sounds
wolenetz 2014/03/21 18:14:01 Done.
+ // compliant coded frame processor (see http://crbug.com/249422) with frames
+ // that always contain valid durations (see http://crbug.com/351166).
+ base::TimeDelta highest_end_timestamp = stream->GetBufferedDuration();
+ DCHECK(highest_end_timestamp > base::TimeDelta());
+
+ increase_duration_cb_.Run(highest_end_timestamp);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698