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

Unified Diff: media/filters/source_buffer_stream.cc

Issue 1018373003: Improving WebM video duration estimation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing try failure, remove unused variable for some builds. Created 5 years, 8 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 | « media/filters/source_buffer_range.cc ('k') | media/filters/source_buffer_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_stream.cc
diff --git a/media/filters/source_buffer_stream.cc b/media/filters/source_buffer_stream.cc
index fb699dbad5e85739b306751898c644c62013b64b..4271ab9601bb44393a6f79f0db3fd09daf7c00fd 100644
--- a/media/filters/source_buffer_stream.cc
+++ b/media/filters/source_buffer_stream.cc
@@ -337,6 +337,11 @@ bool SourceBufferStream::Append(const BufferQueue& buffers) {
track_buffer_.insert(track_buffer_.end(), deleted_buffers.begin(),
deleted_buffers.end());
+ DVLOG(3) << __FUNCTION__ << " Added " << deleted_buffers.size()
+ << " deleted buffers to track buffer. TB size is now "
+ << track_buffer_.size();
+ } else {
+ DVLOG(3) << __FUNCTION__ << " No deleted buffers for track buffer";
}
// Prune any extra buffers in |track_buffer_| if new keyframes
@@ -824,11 +829,14 @@ void SourceBufferStream::PrepareRangesForNextAppend(
DecodeTimestamp end = new_buffers.back()->GetDecodeTimestamp();
base::TimeDelta duration = new_buffers.back()->duration();
- if (duration != kNoTimestamp() && duration > base::TimeDelta()) {
+ // Set end time for remove to include the duration of last buffer. If the
+ // duration is estimated, use 1 microsecond instead to ensure frames are not
+ // accidentally removed due to over-estimation.
+ if (duration != kNoTimestamp() && duration > base::TimeDelta() &&
+ !new_buffers.back()->is_duration_estimated()) {
end += duration;
} else {
- // TODO(acolwell): Ensure all buffers actually have proper
- // duration info so that this hack isn't needed.
+ // TODO(chcunningham): Emit warning when 0ms durations are not expected.
// http://crbug.com/312836
end += base::TimeDelta::FromInternalValue(1);
}
@@ -1077,6 +1085,7 @@ SourceBufferStream::Status SourceBufferStream::GetNextBufferInternal(
return kConfigChange;
}
+ DVLOG(3) << __FUNCTION__ << " Next buffer coming from track_buffer_";
*out_buffer = next_buffer;
track_buffer_.pop_front();
last_output_buffer_timestamp_ = (*out_buffer)->GetDecodeTimestamp();
« no previous file with comments | « media/filters/source_buffer_range.cc ('k') | media/filters/source_buffer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698