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

Side by Side Diff: media/filters/source_buffer_stream.cc

Issue 11785029: Prevent SourceBufferRange.waiting_for_keyframe_ from being lost on range merges. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/filters/source_buffer_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/filters/source_buffer_stream.h" 5 #include "media/filters/source_buffer_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 next_buffer_index_ = -1; 1491 next_buffer_index_ = -1;
1492 waiting_for_keyframe_ = false; 1492 waiting_for_keyframe_ = false;
1493 next_keyframe_timestamp_ = kNoTimestamp(); 1493 next_keyframe_timestamp_ = kNoTimestamp();
1494 } 1494 }
1495 1495
1496 void SourceBufferRange::AppendRangeToEnd(const SourceBufferRange& range, 1496 void SourceBufferRange::AppendRangeToEnd(const SourceBufferRange& range,
1497 bool transfer_current_position) { 1497 bool transfer_current_position) {
1498 DCHECK(CanAppendRangeToEnd(range)); 1498 DCHECK(CanAppendRangeToEnd(range));
1499 DCHECK(!buffers_.empty()); 1499 DCHECK(!buffers_.empty());
1500 1500
1501 if (transfer_current_position) 1501 if (transfer_current_position) {
1502 next_buffer_index_ = range.next_buffer_index_ + buffers_.size(); 1502 if (range.next_buffer_index_ >= 0)
scherkus (not reviewing) 2013/01/07 23:34:06 aside from not updating w_f_k_/n_k_t_, was there a
acolwell GONE FROM CHROMIUM 2013/01/08 00:46:39 The test exposes both problems. When waiting_for_k
1503 next_buffer_index_ = range.next_buffer_index_ + buffers_.size();
1504
1505 waiting_for_keyframe_ = range.waiting_for_keyframe_;
1506 next_keyframe_timestamp_ = range.next_keyframe_timestamp_;
1507 }
1503 1508
1504 AppendBuffersToEnd(range.buffers_); 1509 AppendBuffersToEnd(range.buffers_);
1505 } 1510 }
1506 1511
1507 bool SourceBufferRange::CanAppendRangeToEnd( 1512 bool SourceBufferRange::CanAppendRangeToEnd(
1508 const SourceBufferRange& range) const { 1513 const SourceBufferRange& range) const {
1509 return CanAppendBuffersToEnd(range.buffers_); 1514 return CanAppendBuffersToEnd(range.buffers_);
1510 } 1515 }
1511 1516
1512 bool SourceBufferRange::CanAppendBuffersToEnd( 1517 bool SourceBufferRange::CanAppendBuffersToEnd(
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 return ComputeFudgeRoom(GetApproximateDuration()); 1578 return ComputeFudgeRoom(GetApproximateDuration());
1574 } 1579 }
1575 1580
1576 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { 1581 base::TimeDelta SourceBufferRange::GetApproximateDuration() const {
1577 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); 1582 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run();
1578 DCHECK(max_interbuffer_distance != kNoTimestamp()); 1583 DCHECK(max_interbuffer_distance != kNoTimestamp());
1579 return max_interbuffer_distance; 1584 return max_interbuffer_distance;
1580 } 1585 }
1581 1586
1582 } // namespace media 1587 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/source_buffer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698