OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/formats/webm/webm_audio_client.h" | 5 #include "media/formats/webm/webm_audio_client.h" |
6 | 6 |
7 #include "media/base/audio_decoder_config.h" | 7 #include "media/base/audio_decoder_config.h" |
8 #include "media/base/channel_layout.h" | 8 #include "media/base/channel_layout.h" |
9 #include "media/formats/webm/webm_constants.h" | 9 #include "media/formats/webm/webm_constants.h" |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 int codec_delay_in_frames = 0; | 74 int codec_delay_in_frames = 0; |
75 if (codec_delay != -1) { | 75 if (codec_delay != -1) { |
76 codec_delay_in_frames = | 76 codec_delay_in_frames = |
77 0.5 + | 77 0.5 + |
78 samples_per_second * (static_cast<double>(codec_delay) / | 78 samples_per_second * (static_cast<double>(codec_delay) / |
79 base::Time::kNanosecondsPerSecond); | 79 base::Time::kNanosecondsPerSecond); |
80 } | 80 } |
81 | 81 |
82 config->Initialize( | 82 config->Initialize( |
83 audio_codec, | 83 audio_codec, |
84 (audio_codec == kCodecOpus) ? kSampleFormatS16 : kSampleFormatPlanarF32, | 84 (audio_codec == kCodecOpus) ? kSampleFormatF32 : kSampleFormatPlanarF32, |
DaleCurtis
2014/08/04 20:04:30
Might as well move this up to the (audio_codec ==
| |
85 channel_layout, | 85 channel_layout, |
86 samples_per_second, | 86 samples_per_second, |
87 extra_data, | 87 extra_data, |
88 extra_data_size, | 88 extra_data_size, |
89 is_encrypted, | 89 is_encrypted, |
90 true, | 90 true, |
91 base::TimeDelta::FromMicroseconds( | 91 base::TimeDelta::FromMicroseconds( |
92 (seek_preroll != -1 ? seek_preroll : 0) / 1000), | 92 (seek_preroll != -1 ? seek_preroll : 0) / 1000), |
93 codec_delay_in_frames); | 93 codec_delay_in_frames); |
94 return config->IsValidConfig(); | 94 return config->IsValidConfig(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 MEDIA_LOG(log_cb_) << "Multiple values for id " << std::hex << id | 129 MEDIA_LOG(log_cb_) << "Multiple values for id " << std::hex << id |
130 << " specified (" << *dst << " and " << val << ")"; | 130 << " specified (" << *dst << " and " << val << ")"; |
131 return false; | 131 return false; |
132 } | 132 } |
133 | 133 |
134 *dst = val; | 134 *dst = val; |
135 return true; | 135 return true; |
136 } | 136 } |
137 | 137 |
138 } // namespace media | 138 } // namespace media |
OLD | NEW |