Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |