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

Unified Diff: media/base/stream_parser_buffer.cc

Issue 379693002: Update SourceBufferStream and its unit tests to always expect valid durations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: media/base/stream_parser_buffer.cc
diff --git a/media/base/stream_parser_buffer.cc b/media/base/stream_parser_buffer.cc
index e9d64272c4d84670c4b2e7e1fe739433e856412b..8321ccafb244b656006ee614a26331c8583587d9 100644
--- a/media/base/stream_parser_buffer.cc
+++ b/media/base/stream_parser_buffer.cc
@@ -106,6 +106,10 @@ void StreamParserBuffer::SetConfigId(int config_id) {
void StreamParserBuffer::ConvertToSpliceBuffer(
const BufferQueue& pre_splice_buffers) {
DCHECK(splice_buffers_.empty());
+ DCHECK(duration() > base::TimeDelta())
+ << "Only buffers with a valid duration can convert to a splice buffer."
+ << " pts " << timestamp().InSecondsF()
+ << " dts " << GetDecodeTimestamp().InSecondsF();
wolenetz 2014/07/09 22:42:16 nit: add dur to logging
acolwell GONE FROM CHROMIUM 2014/07/15 18:49:26 Done.
DCHECK(!end_of_stream());
// Make a copy of this first, before making any changes.
@@ -139,6 +143,8 @@ void StreamParserBuffer::ConvertToSpliceBuffer(
// The splice duration is the duration of all buffers before the splice plus
// the highest ending timestamp after the splice point.
+ DCHECK(overlapping_buffer->duration() > base::TimeDelta());
+ DCHECK(pre_splice_buffers.back()->duration() > base::TimeDelta());
set_duration(
std::max(overlapping_buffer->timestamp() + overlapping_buffer->duration(),
pre_splice_buffers.back()->timestamp() +

Powered by Google App Engine
This is Rietveld 408576698