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

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

Issue 22243002: GTTF: Enable glibcxx debug mode for Debug builds by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 ranges_.pop_front(); 374 ranges_.pop_front();
375 } 375 }
376 } 376 }
377 377
378 void SourceBufferStream::OnNewMediaSegment( 378 void SourceBufferStream::OnNewMediaSegment(
379 base::TimeDelta media_segment_start_time) { 379 base::TimeDelta media_segment_start_time) {
380 DCHECK(!end_of_stream_); 380 DCHECK(!end_of_stream_);
381 media_segment_start_time_ = media_segment_start_time; 381 media_segment_start_time_ = media_segment_start_time;
382 new_media_segment_ = true; 382 new_media_segment_ = true;
383 383
384 RangeList::iterator last_range = range_for_next_append_;
385 range_for_next_append_ = FindExistingRangeFor(media_segment_start_time); 384 range_for_next_append_ = FindExistingRangeFor(media_segment_start_time);
386 385
387 // Only reset |last_appended_buffer_timestamp_| if this new media segment is 386 // Only reset |last_appended_buffer_timestamp_| if this new media segment is
388 // not adjacent to the previous media segment appended to the stream. 387 // not adjacent to the previous media segment appended to the stream.
389 if (range_for_next_append_ == ranges_.end() || 388 if (range_for_next_append_ == ranges_.end() ||
390 !AreAdjacentInSequence(last_appended_buffer_timestamp_, 389 !AreAdjacentInSequence(last_appended_buffer_timestamp_,
391 media_segment_start_time)) { 390 media_segment_start_time)) {
392 last_appended_buffer_timestamp_ = kNoTimestamp(); 391 last_appended_buffer_timestamp_ = kNoTimestamp();
393 last_appended_buffer_is_keyframe_ = false; 392 last_appended_buffer_is_keyframe_ = false;
394 } else {
395 DCHECK(last_range == range_for_next_append_);
396 } 393 }
397 } 394 }
398 395
399 bool SourceBufferStream::Append( 396 bool SourceBufferStream::Append(
400 const SourceBufferStream::BufferQueue& buffers) { 397 const SourceBufferStream::BufferQueue& buffers) {
401 TRACE_EVENT2("mse", "SourceBufferStream::Append", 398 TRACE_EVENT2("mse", "SourceBufferStream::Append",
402 "stream type", GetStreamTypeName(), 399 "stream type", GetStreamTypeName(),
403 "buffers to append", buffers.size()); 400 "buffers to append", buffers.size());
404 401
405 DCHECK(!buffers.empty()); 402 DCHECK(!buffers.empty());
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 return ComputeFudgeRoom(GetApproximateDuration()); 1947 return ComputeFudgeRoom(GetApproximateDuration());
1951 } 1948 }
1952 1949
1953 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { 1950 base::TimeDelta SourceBufferRange::GetApproximateDuration() const {
1954 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); 1951 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run();
1955 DCHECK(max_interbuffer_distance != kNoTimestamp()); 1952 DCHECK(max_interbuffer_distance != kNoTimestamp());
1956 return max_interbuffer_distance; 1953 return max_interbuffer_distance;
1957 } 1954 }
1958 1955
1959 } // namespace media 1956 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698