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

Unified Diff: media/filters/source_buffer_stream.cc

Issue 1119163005: Return EOS when selected_range_ is NULL in SourceBufferStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nipicks Created 5 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 | « media/filters/source_buffer_stream.h ('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 4271ab9601bb44393a6f79f0db3fd09daf7c00fd..0dcd51c3e90da66e1f5c47d0671afd5f6e39277a 100644
--- a/media/filters/source_buffer_stream.cc
+++ b/media/filters/source_buffer_stream.cc
@@ -928,7 +928,7 @@ void SourceBufferStream::Seek(base::TimeDelta timestamp) {
}
bool SourceBufferStream::IsSeekPending() const {
- return !(end_of_stream_ && IsEndSelected()) && seek_pending_;
+ return seek_pending_ && !IsEndOfStreamReached();
}
void SourceBufferStream::OnSetDuration(base::TimeDelta duration) {
@@ -1098,9 +1098,11 @@ SourceBufferStream::Status SourceBufferStream::GetNextBufferInternal(
return kSuccess;
}
+ DCHECK(track_buffer_.empty());
if (!selected_range_ || !selected_range_->HasNextBuffer()) {
- if (end_of_stream_ && IsEndSelected())
+ if (IsEndOfStreamReached()) {
return kEndOfStream;
+ }
DVLOG(3) << __FUNCTION__ << " " << GetStreamTypeName()
<< ": returning kNeedBuffer "
<< (selected_range_ ? "(selected range has no next buffer)"
@@ -1205,7 +1207,10 @@ void SourceBufferStream::UnmarkEndOfStream() {
end_of_stream_ = false;
}
-bool SourceBufferStream::IsEndSelected() const {
+bool SourceBufferStream::IsEndOfStreamReached() const {
+ if (!end_of_stream_ || !track_buffer_.empty())
+ return false;
+
if (ranges_.empty())
return true;
@@ -1215,6 +1220,9 @@ bool SourceBufferStream::IsEndSelected() const {
return seek_buffer_timestamp_ >= last_range_end_time;
}
+ if (!selected_range_)
+ return true;
+
return selected_range_ == ranges_.back();
}
« no previous file with comments | « media/filters/source_buffer_stream.h ('k') | media/filters/source_buffer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698