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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1328 bool SourceBufferStream::UpdateAudioConfig(const AudioDecoderConfig& config) { | 1328 bool SourceBufferStream::UpdateAudioConfig(const AudioDecoderConfig& config) { |
1329 DCHECK(!audio_configs_.empty()); | 1329 DCHECK(!audio_configs_.empty()); |
1330 DCHECK(video_configs_.empty()); | 1330 DCHECK(video_configs_.empty()); |
1331 DVLOG(3) << "UpdateAudioConfig."; | 1331 DVLOG(3) << "UpdateAudioConfig."; |
1332 | 1332 |
1333 if (audio_configs_[0].codec() != config.codec()) { | 1333 if (audio_configs_[0].codec() != config.codec()) { |
1334 MEDIA_LOG(log_cb_) << "Audio codec changes not allowed."; | 1334 MEDIA_LOG(log_cb_) << "Audio codec changes not allowed."; |
1335 return false; | 1335 return false; |
1336 } | 1336 } |
1337 | 1337 |
1338 if (audio_configs_[0].samples_per_second() != config.samples_per_second()) { | 1338 /*if (audio_configs_[0].samples_per_second() != config.samples_per_second()) { |
DaleCurtis
2014/03/24 23:04:53
Stay / go?
rileya (GONE FROM CHROMIUM)
2014/03/24 23:09:43
Whoops, missed this, removed.
| |
1339 MEDIA_LOG(log_cb_) << "Audio sample rate changes not allowed."; | 1339 MEDIA_LOG(log_cb_) << "Audio sample rate changes not allowed."; |
1340 return false; | 1340 return false; |
1341 } | 1341 } |
1342 | 1342 |
1343 if (audio_configs_[0].channel_layout() != config.channel_layout()) { | 1343 if (audio_configs_[0].channel_layout() != config.channel_layout()) { |
1344 MEDIA_LOG(log_cb_) << "Audio channel layout changes not allowed."; | 1344 MEDIA_LOG(log_cb_) << "Audio channel layout changes not allowed."; |
1345 return false; | 1345 return false; |
1346 } | 1346 } |
1347 | 1347 |
1348 if (audio_configs_[0].bits_per_channel() != config.bits_per_channel()) { | 1348 if (audio_configs_[0].bits_per_channel() != config.bits_per_channel()) { |
1349 MEDIA_LOG(log_cb_) << "Audio bits per channel changes not allowed."; | 1349 MEDIA_LOG(log_cb_) << "Audio bits per channel changes not allowed."; |
1350 return false; | 1350 return false; |
1351 } | 1351 }*/ |
1352 | 1352 |
1353 if (audio_configs_[0].is_encrypted() != config.is_encrypted()) { | 1353 if (audio_configs_[0].is_encrypted() != config.is_encrypted()) { |
1354 MEDIA_LOG(log_cb_) << "Audio encryption changes not allowed."; | 1354 MEDIA_LOG(log_cb_) << "Audio encryption changes not allowed."; |
1355 return false; | 1355 return false; |
1356 } | 1356 } |
1357 | 1357 |
1358 // Check to see if the new config matches an existing one. | 1358 // Check to see if the new config matches an existing one. |
1359 for (size_t i = 0; i < audio_configs_.size(); ++i) { | 1359 for (size_t i = 0; i < audio_configs_.size(); ++i) { |
1360 if (config.Matches(audio_configs_[i])) { | 1360 if (config.Matches(audio_configs_[i])) { |
1361 append_config_index_ = i; | 1361 append_config_index_ = i; |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2080 return ComputeFudgeRoom(GetApproximateDuration()); | 2080 return ComputeFudgeRoom(GetApproximateDuration()); |
2081 } | 2081 } |
2082 | 2082 |
2083 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { | 2083 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { |
2084 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); | 2084 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); |
2085 DCHECK(max_interbuffer_distance != kNoTimestamp()); | 2085 DCHECK(max_interbuffer_distance != kNoTimestamp()); |
2086 return max_interbuffer_distance; | 2086 return max_interbuffer_distance; |
2087 } | 2087 } |
2088 | 2088 |
2089 } // namespace media | 2089 } // namespace media |
OLD | NEW |