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

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

Issue 213253006: MSE: Populate WebM missing duration with DefaultDuration, derived, or default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 // position. 958 // position.
959 // TODO(acolwell): Figure out a more elegant way to do this. 959 // TODO(acolwell): Figure out a more elegant way to do this.
960 SeekAndSetSelectedRange(*range_for_next_append_, seek_timestamp); 960 SeekAndSetSelectedRange(*range_for_next_append_, seek_timestamp);
961 temporarily_select_range = true; 961 temporarily_select_range = true;
962 } 962 }
963 } 963 }
964 964
965 // Handle splices between the existing buffers and the new buffers. If a 965 // Handle splices between the existing buffers and the new buffers. If a
966 // splice is generated the timestamp and duration of the first buffer in 966 // splice is generated the timestamp and duration of the first buffer in
967 // |new_buffers| will be modified. 967 // |new_buffers| will be modified.
968 GenerateSpliceFrame(new_buffers); 968
969 // TODO(dalecurtis): GenerateSpliceFrame() causes crash in
970 // ChunkDemuxerTest.OutOfOrderClusters when all frames in a cluster have
acolwell GONE FROM CHROMIUM 2014/03/26 23:32:04 nit: Remove comment since Dale has already disable
wolenetz 2014/03/27 18:01:48 Done (and rebased onto ToT that now includes Dale'
971 // duration, including SimpleBlock frames whose duration is derived from
972 // a subsequent BlockGroup frame's timestamp for the same track in the
973 // cluster. See http://crbug.com/356805.
974 // GenerateSpliceFrame(new_buffers);
969 975
970 base::TimeDelta prev_timestamp = last_appended_buffer_timestamp_; 976 base::TimeDelta prev_timestamp = last_appended_buffer_timestamp_;
971 bool prev_is_keyframe = last_appended_buffer_is_keyframe_; 977 bool prev_is_keyframe = last_appended_buffer_is_keyframe_;
972 base::TimeDelta next_timestamp = new_buffers.front()->GetDecodeTimestamp(); 978 base::TimeDelta next_timestamp = new_buffers.front()->GetDecodeTimestamp();
973 bool next_is_keyframe = new_buffers.front()->IsKeyframe(); 979 bool next_is_keyframe = new_buffers.front()->IsKeyframe();
974 980
975 if (prev_timestamp != kNoTimestamp() && prev_timestamp != next_timestamp) { 981 if (prev_timestamp != kNoTimestamp() && prev_timestamp != next_timestamp) {
976 // Clean up the old buffers between the last appended buffer and the 982 // Clean up the old buffers between the last appended buffer and the
977 // beginning of |new_buffers|. 983 // beginning of |new_buffers|.
978 RemoveInternal(prev_timestamp, next_timestamp, true, deleted_buffers); 984 RemoveInternal(prev_timestamp, next_timestamp, true, deleted_buffers);
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 if (buffer->end_of_stream() || buffer->timestamp() >= end) 2187 if (buffer->end_of_stream() || buffer->timestamp() >= end)
2182 break; 2188 break;
2183 if (buffer->timestamp() + buffer->duration() <= start) 2189 if (buffer->timestamp() + buffer->duration() <= start)
2184 continue; 2190 continue;
2185 buffers->push_back(buffer); 2191 buffers->push_back(buffer);
2186 } 2192 }
2187 return previous_size < buffers->size(); 2193 return previous_size < buffers->size();
2188 } 2194 }
2189 2195
2190 } // namespace media 2196 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698