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

Unified Diff: content/renderer/media/websourcebuffer_impl.cc

Issue 198213008: Fix DCHECK caused by specifying a negative timestamp offset. (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
« 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: content/renderer/media/websourcebuffer_impl.cc
diff --git a/content/renderer/media/websourcebuffer_impl.cc b/content/renderer/media/websourcebuffer_impl.cc
index 0863b65e29afd3403ec82cae0557eec789ed7879..ff3ac5b0079eaad191862c5bce60da8687bba712 100644
--- a/content/renderer/media/websourcebuffer_impl.cc
+++ b/content/renderer/media/websourcebuffer_impl.cc
@@ -4,6 +4,8 @@
#include "content/renderer/media/websourcebuffer_impl.h"
+#include <limits>
+
#include "base/float_util.h"
#include "media/filters/chunk_demuxer.h"
@@ -11,7 +13,8 @@ namespace content {
static base::TimeDelta DoubleToTimeDelta(double time) {
DCHECK(!base::IsNaN(time));
- DCHECK_GE(time, 0);
+ DCHECK_NE(time, -std::numeric_limits<double>::infinity());
+
if (time == std::numeric_limits<double>::infinity())
return media::kInfiniteDuration();
@@ -89,6 +92,8 @@ void WebSourceBufferImpl::abort() {
}
void WebSourceBufferImpl::remove(double start, double end) {
+ DCHECK_GE(start, 0);
+ DCHECK_GE(end, 0);
demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end));
}
@@ -101,10 +106,12 @@ bool WebSourceBufferImpl::setTimestampOffset(double offset) {
}
void WebSourceBufferImpl::setAppendWindowStart(double start) {
+ DCHECK_GE(start, 0);
append_window_start_ = DoubleToTimeDelta(start);
}
void WebSourceBufferImpl::setAppendWindowEnd(double end) {
+ DCHECK_GE(end, 0);
append_window_end_ = DoubleToTimeDelta(end);
}
« 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