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

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

Issue 2827983004: Fix MSE garbage collection for disabled media tracks (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_state.h" 5 #include "media/filters/source_buffer_state.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 for (const auto& it : video_streams_) { 250 for (const auto& it : video_streams_) {
251 it.second->Remove(start, end, duration); 251 it.second->Remove(start, end, duration);
252 } 252 }
253 253
254 for (const auto& it : text_streams_) { 254 for (const auto& it : text_streams_) {
255 it.second->Remove(start, end, duration); 255 it.second->Remove(start, end, duration);
256 } 256 }
257 } 257 }
258 258
259 bool SourceBufferState::EvictCodedFrames(DecodeTimestamp media_time, 259 bool SourceBufferState::EvictCodedFrames(base::TimeDelta media_time,
260 size_t newDataSize) { 260 size_t newDataSize) {
261 size_t total_buffered_size = 0; 261 size_t total_buffered_size = 0;
262 for (const auto& it : audio_streams_) 262 for (const auto& it : audio_streams_)
263 total_buffered_size += it.second->GetBufferedSize(); 263 total_buffered_size += it.second->GetBufferedSize();
264 for (const auto& it : video_streams_) 264 for (const auto& it : video_streams_)
265 total_buffered_size += it.second->GetBufferedSize(); 265 total_buffered_size += it.second->GetBufferedSize();
266 for (const auto& it : text_streams_) 266 for (const auto& it : text_streams_)
267 total_buffered_size += it.second->GetBufferedSize(); 267 total_buffered_size += it.second->GetBufferedSize();
268 268
269 DVLOG(3) << __func__ << " media_time=" << media_time.InSecondsF() 269 DVLOG(3) << __func__ << " media_time=" << media_time.InSecondsF()
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 } 908 }
909 void SourceBufferState::OnSourceInitDone( 909 void SourceBufferState::OnSourceInitDone(
910 const StreamParser::InitParameters& params) { 910 const StreamParser::InitParameters& params) {
911 DCHECK_EQ(state_, PENDING_PARSER_INIT); 911 DCHECK_EQ(state_, PENDING_PARSER_INIT);
912 state_ = PARSER_INITIALIZED; 912 state_ = PARSER_INITIALIZED;
913 auto_update_timestamp_offset_ = params.auto_update_timestamp_offset; 913 auto_update_timestamp_offset_ = params.auto_update_timestamp_offset;
914 base::ResetAndReturn(&init_cb_).Run(params); 914 base::ResetAndReturn(&init_cb_).Run(params);
915 } 915 }
916 916
917 } // namespace media 917 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698