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

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

Issue 178153004: Enable round-tripping and updating of WebSourceBufferImpl timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow NULL for WSBI::append()'s |new_timestamp_offset| parameter Created 6 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
Index: content/renderer/media/websourcebuffer_impl.cc
diff --git a/content/renderer/media/websourcebuffer_impl.cc b/content/renderer/media/websourcebuffer_impl.cc
index a7d8d8a537803b4f9a2a8bdf42777af21720a5a0..1791867944d58d85ccd5af0c4b1d3ba313d71a58 100644
--- a/content/renderer/media/websourcebuffer_impl.cc
+++ b/content/renderer/media/websourcebuffer_impl.cc
@@ -5,6 +5,7 @@
#include "content/renderer/media/websourcebuffer_impl.h"
#include "base/float_util.h"
+#include "media/base/buffers.h"
#include "media/filters/chunk_demuxer.h"
namespace content {
@@ -60,7 +61,22 @@ blink::WebTimeRanges WebSourceBufferImpl::buffered() {
}
void WebSourceBufferImpl::append(const unsigned char* data, unsigned length) {
- demuxer_->AppendData(id_, data, length);
+ bool offset_updated = append(data, length, NULL);
+ DCHECK(!offset_updated);
+}
+
+bool WebSourceBufferImpl::append(
+ const unsigned char* data,
+ unsigned length,
+ double* new_timestamp_offset) {
+ base::TimeDelta new_offset_if_updated;
+ demuxer_->AppendData(id_, data, length, &new_offset_if_updated);
acolwell GONE FROM CHROMIUM 2014/02/27 18:27:21 Sorry to keep causing thrashing on this. Based on
wolenetz 2014/02/27 21:48:49 Done.
+ if (new_timestamp_offset && new_offset_if_updated != media::kNoTimestamp()) {
+ *new_timestamp_offset = new_offset_if_updated.InSecondsF();
+ return true;
+ }
+
+ return false;
}
void WebSourceBufferImpl::abort() {

Powered by Google App Engine
This is Rietveld 408576698