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 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
779 // position. | 779 // position. |
780 // TODO(acolwell): Figure out a more elegant way to do this. | 780 // TODO(acolwell): Figure out a more elegant way to do this. |
781 SeekAndSetSelectedRange(*range_for_next_append_, seek_timestamp); | 781 SeekAndSetSelectedRange(*range_for_next_append_, seek_timestamp); |
782 temporarily_select_range = true; | 782 temporarily_select_range = true; |
783 } | 783 } |
784 } | 784 } |
785 | 785 |
786 // Handle splices between the existing buffers and the new buffers. If a | 786 // Handle splices between the existing buffers and the new buffers. If a |
787 // splice is generated the timestamp and duration of the first buffer in | 787 // splice is generated the timestamp and duration of the first buffer in |
788 // |new_buffers| will be modified. | 788 // |new_buffers| will be modified. |
789 if (splice_frames_enabled_) | 789 if (splice_frames_enabled_) { |
wolenetz
2015/03/28 00:26:06
nit: why { } here and not elsewhere like below, an
chcunningham
2015/04/13 23:25:18
Reverted. I see this file has plenty of single lin
wolenetz
2015/04/15 02:55:23
No, I personally hope you're not in the minority o
| |
790 GenerateSpliceFrame(new_buffers); | 790 GenerateSpliceFrame(new_buffers); |
791 } | |
791 | 792 |
792 DecodeTimestamp prev_timestamp = last_appended_buffer_timestamp_; | 793 DecodeTimestamp prev_timestamp = last_appended_buffer_timestamp_; |
793 bool prev_is_keyframe = last_appended_buffer_is_keyframe_; | 794 bool prev_is_keyframe = last_appended_buffer_is_keyframe_; |
794 DecodeTimestamp next_timestamp = new_buffers.front()->GetDecodeTimestamp(); | 795 DecodeTimestamp next_timestamp = new_buffers.front()->GetDecodeTimestamp(); |
795 bool next_is_keyframe = new_buffers.front()->is_key_frame(); | 796 bool next_is_keyframe = new_buffers.front()->is_key_frame(); |
796 | 797 |
797 if (prev_timestamp != kNoDecodeTimestamp() && | 798 if (prev_timestamp != kNoDecodeTimestamp() && |
798 prev_timestamp != next_timestamp) { | 799 prev_timestamp != next_timestamp) { |
799 // Clean up the old buffers between the last appended buffer and the | 800 // Clean up the old buffers between the last appended buffer and the |
800 // beginning of |new_buffers|. | 801 // beginning of |new_buffers|. |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1562 return false; | 1563 return false; |
1563 | 1564 |
1564 DCHECK_NE(have_splice_buffers, have_preroll_buffer); | 1565 DCHECK_NE(have_splice_buffers, have_preroll_buffer); |
1565 splice_buffers_index_ = 0; | 1566 splice_buffers_index_ = 0; |
1566 pending_buffer_.swap(*out_buffer); | 1567 pending_buffer_.swap(*out_buffer); |
1567 pending_buffers_complete_ = false; | 1568 pending_buffers_complete_ = false; |
1568 return true; | 1569 return true; |
1569 } | 1570 } |
1570 | 1571 |
1571 } // namespace media | 1572 } // namespace media |
OLD | NEW |