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

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: Address CR comments. Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.h » ('j') | media/filters/chunk_demuxer_unittest.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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
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() {
wolenetz 2014/05/06 00:04:32 Upon further inspection of the MSE spec, and given
damienv1 2014/05/06 00:29:00 Added a comment which references this bug.
91 demuxer_->Abort(id_); 91 demuxer_->Abort(id_,
92 append_window_start_, append_window_end_,
93 &timestamp_offset_);
92 } 94 }
93 95
94 void WebSourceBufferImpl::remove(double start, double end) { 96 void WebSourceBufferImpl::remove(double start, double end) {
95 DCHECK_GE(start, 0); 97 DCHECK_GE(start, 0);
96 DCHECK_GE(end, 0); 98 DCHECK_GE(end, 0);
97 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end)); 99 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end));
98 } 100 }
99 101
100 bool WebSourceBufferImpl::setTimestampOffset(double offset) { 102 bool WebSourceBufferImpl::setTimestampOffset(double offset) {
101 if (demuxer_->IsParsingMediaSegment(id_)) 103 if (demuxer_->IsParsingMediaSegment(id_))
(...skipping 12 matching lines...) Expand all
114 DCHECK_GE(end, 0); 116 DCHECK_GE(end, 0);
115 append_window_end_ = DoubleToTimeDelta(end); 117 append_window_end_ = DoubleToTimeDelta(end);
116 } 118 }
117 119
118 void WebSourceBufferImpl::removedFromMediaSource() { 120 void WebSourceBufferImpl::removedFromMediaSource() {
119 demuxer_->RemoveId(id_); 121 demuxer_->RemoveId(id_);
120 demuxer_ = NULL; 122 demuxer_ = NULL;
121 } 123 }
122 124
123 } // namespace content 125 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.h » ('j') | media/filters/chunk_demuxer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698