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

Side by Side Diff: content/renderer/media/websourcebuffer_impl.cc

Issue 256583006: Fix possible buffer emission during an abort. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.h » ('j') | media/filters/chunk_demuxer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/websourcebuffer_impl.h" 5 #include "content/renderer/media/websourcebuffer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/float_util.h" 9 #include "base/float_util.h"
10 #include "media/filters/chunk_demuxer.h" 10 #include "media/filters/chunk_demuxer.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Coded frame processing may update the timestamp offset. If the caller 81 // Coded frame processing may update the timestamp offset. If the caller
82 // provides a non-NULL |timestamp_offset| and frame processing changes the 82 // provides a non-NULL |timestamp_offset| and frame processing changes the
83 // timestamp offset, report the new offset to the caller. Do not update the 83 // timestamp offset, report the new offset to the caller. Do not update the
84 // caller's offset otherwise, to preserve any pre-existing value that may have 84 // caller's offset otherwise, to preserve any pre-existing value that may have
85 // more than microsecond precision. 85 // more than microsecond precision.
86 if (timestamp_offset && old_offset != timestamp_offset_) 86 if (timestamp_offset && old_offset != timestamp_offset_)
87 *timestamp_offset = timestamp_offset_.InSecondsF(); 87 *timestamp_offset = timestamp_offset_.InSecondsF();
88 } 88 }
89 89
90 void WebSourceBufferImpl::abort() { 90 void WebSourceBufferImpl::abort() {
91 demuxer_->Abort(id_); 91 demuxer_->Abort(id_, timestamp_offset_);
wolenetz 2014/04/25 21:00:32 append_window_{start,end}_ should also be part of
damienv1 2014/05/05 22:39:13 Done. Somehow, I was thinking that the timestamp o
92 } 92 }
93 93
94 void WebSourceBufferImpl::remove(double start, double end) { 94 void WebSourceBufferImpl::remove(double start, double end) {
95 DCHECK_GE(start, 0); 95 DCHECK_GE(start, 0);
96 DCHECK_GE(end, 0); 96 DCHECK_GE(end, 0);
97 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end)); 97 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end));
98 } 98 }
99 99
100 bool WebSourceBufferImpl::setTimestampOffset(double offset) { 100 bool WebSourceBufferImpl::setTimestampOffset(double offset) {
101 if (demuxer_->IsParsingMediaSegment(id_)) 101 if (demuxer_->IsParsingMediaSegment(id_))
(...skipping 12 matching lines...) Expand all
114 DCHECK_GE(end, 0); 114 DCHECK_GE(end, 0);
115 append_window_end_ = DoubleToTimeDelta(end); 115 append_window_end_ = DoubleToTimeDelta(end);
116 } 116 }
117 117
118 void WebSourceBufferImpl::removedFromMediaSource() { 118 void WebSourceBufferImpl::removedFromMediaSource() {
119 demuxer_->RemoveId(id_); 119 demuxer_->RemoveId(id_);
120 demuxer_ = NULL; 120 demuxer_ = NULL;
121 } 121 }
122 122
123 } // namespace content 123 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.h » ('j') | media/filters/chunk_demuxer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698