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

Unified Diff: media/base/audio_decoder_config.cc

Issue 12638030: Make AudioDecoderConfig copyable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/audio_decoder_config.h ('k') | media/base/decryptor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_decoder_config.cc
diff --git a/media/base/audio_decoder_config.cc b/media/base/audio_decoder_config.cc
index ee154a07d2b2cb9be3e3e7b62f8ff505eb615c4e..a4e57c2df478caf03ad1501448ca5ba92d73cab8 100644
--- a/media/base/audio_decoder_config.cc
+++ b/media/base/audio_decoder_config.cc
@@ -39,7 +39,6 @@ AudioDecoderConfig::AudioDecoderConfig()
channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED),
samples_per_second_(0),
bytes_per_frame_(0),
- extra_data_size_(0),
is_encrypted_(false) {
}
@@ -83,17 +82,9 @@ void AudioDecoderConfig::Initialize(AudioCodec codec,
codec_ = codec;
channel_layout_ = channel_layout;
samples_per_second_ = samples_per_second;
- extra_data_size_ = extra_data_size;
sample_format_ = sample_format;
bits_per_channel_ = SampleFormatToBitsPerChannel(sample_format);
-
- if (extra_data_size_ > 0) {
- extra_data_.reset(new uint8[extra_data_size_]);
- memcpy(extra_data_.get(), extra_data, extra_data_size_);
- } else {
- extra_data_.reset();
- }
-
+ extra_data_.assign(extra_data, extra_data + extra_data_size);
is_encrypted_ = is_encrypted;
int channels = ChannelLayoutToChannelCount(channel_layout_);
@@ -124,15 +115,4 @@ bool AudioDecoderConfig::Matches(const AudioDecoderConfig& config) const {
(sample_format() == config.sample_format()));
}
-void AudioDecoderConfig::CopyFrom(const AudioDecoderConfig& audio_config) {
- Initialize(audio_config.codec(),
- audio_config.sample_format(),
- audio_config.channel_layout(),
- audio_config.samples_per_second(),
- audio_config.extra_data(),
- audio_config.extra_data_size(),
- audio_config.is_encrypted(),
- false);
-}
-
} // namespace media
« no previous file with comments | « media/base/audio_decoder_config.h ('k') | media/base/decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698