AudioDecoder: Replace Init() with Reset()

The Init() method was previously used to initialize and reset
decoders, and returned an error code. The new Reset() method is used
for reset only; the constructor is now responsible for fully
initializing the AudioDecoder.

Reset() doesn't return an error code; it turned out that none of the
functions it ended up calling could actually fail, so this CL removes
their error return codes as well.

R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1319683002 .

Cr-Commit-Position: refs/heads/master@{#9798}
This commit is contained in:
Karl Wiberg
2015-08-27 15:22:11 +02:00
parent 1c3dd38cb8
commit 4376648df0
38 changed files with 105 additions and 208 deletions

View File

@ -72,7 +72,6 @@ int DecoderDatabase::InsertExternal(uint8_t rtp_payload_type,
if (!decoder) {
return kInvalidPointer;
}
decoder->Init();
std::pair<DecoderMap::iterator, bool> ret;
DecoderInfo info(codec_type, fs_hz, decoder, true);
ret = decoders_.insert(std::make_pair(rtp_payload_type, info));
@ -136,7 +135,6 @@ AudioDecoder* DecoderDatabase::GetDecoder(uint8_t rtp_payload_type) {
AudioDecoder* decoder = CreateAudioDecoder(info->codec_type);
assert(decoder); // Should not be able to have an unsupported codec here.
info->decoder = decoder;
info->decoder->Init();
}
return info->decoder;
}