| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_range.h" | 5 #include "media/filters/source_buffer_range.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "media/base/timestamp_constants.h" | 9 #include "media/base/timestamp_constants.h" |
| 10 | 10 |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 453 |
| 454 bool SourceBufferRange::HasNextBuffer() const { | 454 bool SourceBufferRange::HasNextBuffer() const { |
| 455 return next_buffer_index_ >= 0 && | 455 return next_buffer_index_ >= 0 && |
| 456 next_buffer_index_ < static_cast<int>(buffers_.size()); | 456 next_buffer_index_ < static_cast<int>(buffers_.size()); |
| 457 } | 457 } |
| 458 | 458 |
| 459 int SourceBufferRange::GetNextConfigId() const { | 459 int SourceBufferRange::GetNextConfigId() const { |
| 460 CHECK(HasNextBuffer()) << next_buffer_index_; | 460 CHECK(HasNextBuffer()) << next_buffer_index_; |
| 461 // If the next buffer is an audio splice frame, the next effective config id | 461 // If the next buffer is an audio splice frame, the next effective config id |
| 462 // comes from the first fade out preroll buffer. | 462 // comes from the first fade out preroll buffer. |
| 463 return buffers_[next_buffer_index_]->GetSpliceBufferConfigId(0); | 463 return buffers_[next_buffer_index_]->GetConfigId(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 DecodeTimestamp SourceBufferRange::GetNextTimestamp() const { | 466 DecodeTimestamp SourceBufferRange::GetNextTimestamp() const { |
| 467 CHECK(!buffers_.empty()) << next_buffer_index_; | 467 CHECK(!buffers_.empty()) << next_buffer_index_; |
| 468 CHECK(HasNextBufferPosition()) << next_buffer_index_ | 468 CHECK(HasNextBufferPosition()) << next_buffer_index_ |
| 469 << ", size=" << buffers_.size(); | 469 << ", size=" << buffers_.size(); |
| 470 | 470 |
| 471 if (next_buffer_index_ >= static_cast<int>(buffers_.size())) { | 471 if (next_buffer_index_ >= static_cast<int>(buffers_.size())) { |
| 472 return kNoDecodeTimestamp(); | 472 return kNoDecodeTimestamp(); |
| 473 } | 473 } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 } | 635 } |
| 636 | 636 |
| 637 if (buffer->timestamp() + buffer->duration() <= start.ToPresentationTime()) | 637 if (buffer->timestamp() + buffer->duration() <= start.ToPresentationTime()) |
| 638 continue; | 638 continue; |
| 639 buffers->push_back(buffer); | 639 buffers->push_back(buffer); |
| 640 } | 640 } |
| 641 return previous_size < buffers->size(); | 641 return previous_size < buffers->size(); |
| 642 } | 642 } |
| 643 | 643 |
| 644 } // namespace media | 644 } // namespace media |
| OLD | NEW |