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

Unified Diff: media/filters/source_buffer_range.cc

Issue 1673293003: MSE: Use CHECKs to obtain more detail on hard-to-repro crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A couple further changes to CHECK Created 4 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_range.cc
diff --git a/media/filters/source_buffer_range.cc b/media/filters/source_buffer_range.cc
index 562e14e0964a4ebdaf438598a6de4670732b2b79..bd99bc01d3c395d099b061d94fda12607ba05818 100644
--- a/media/filters/source_buffer_range.cc
+++ b/media/filters/source_buffer_range.cc
@@ -98,7 +98,8 @@ void SourceBufferRange::Seek(DecodeTimestamp timestamp) {
KeyframeMap::iterator result = GetFirstKeyframeAtOrBefore(timestamp);
next_buffer_index_ = result->second - keyframe_map_index_base_;
- DCHECK_LT(next_buffer_index_, static_cast<int>(buffers_.size()));
+ CHECK_LT(next_buffer_index_, static_cast<int>(buffers_.size()))
+ << next_buffer_index_ << ", size = " << buffers_.size();
}
void SourceBufferRange::SeekAheadTo(DecodeTimestamp timestamp) {
@@ -127,7 +128,7 @@ void SourceBufferRange::SeekAhead(DecodeTimestamp timestamp,
}
void SourceBufferRange::SeekToStart() {
- DCHECK(!buffers_.empty());
+ CHECK(!buffers_.empty());
next_buffer_index_ = 0;
}
@@ -173,6 +174,8 @@ SourceBufferRange* SourceBufferRange::SplitRange(DecodeTimestamp timestamp) {
// this range and |split_range| accordingly.
if (next_buffer_index_ >= static_cast<int>(buffers_.size())) {
split_range->next_buffer_index_ = next_buffer_index_ - keyframe_index;
+ CHECK_GE(split_range->next_buffer_index_, 0)
+ << split_range->next_buffer_index_;
ResetNextBufferPosition();
}
@@ -263,7 +266,8 @@ size_t SourceBufferRange::DeleteGOPFromFront(BufferQueue* deleted_buffers) {
if (next_buffer_index_ > -1) {
next_buffer_index_ -= buffers_deleted;
- DCHECK_GE(next_buffer_index_, 0);
+ CHECK_GE(next_buffer_index_, 0) << next_buffer_index_ << ", deleted "
+ << buffers_deleted;
}
// Invalidate media segment start time if we've deleted the first buffer of
@@ -443,15 +447,16 @@ bool SourceBufferRange::HasNextBuffer() const {
}
int SourceBufferRange::GetNextConfigId() const {
- DCHECK(HasNextBuffer());
+ CHECK(HasNextBuffer()) << next_buffer_index_;
// If the next buffer is an audio splice frame, the next effective config id
// comes from the first fade out preroll buffer.
return buffers_[next_buffer_index_]->GetSpliceBufferConfigId(0);
}
DecodeTimestamp SourceBufferRange::GetNextTimestamp() const {
- DCHECK(!buffers_.empty());
- DCHECK(HasNextBufferPosition());
+ CHECK(!buffers_.empty()) << next_buffer_index_;
+ CHECK(HasNextBufferPosition()) << next_buffer_index_
+ << ", size=" << buffers_.size();
if (next_buffer_index_ >= static_cast<int>(buffers_.size())) {
return kNoDecodeTimestamp();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698