Optional: Use nullopt and implicit construction in /modules/audio_coding

Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=kwiberg@webrtc.org

Bug: None
Change-Id: I055411a3e521964c81100869a197dd92f5608f1b
Reviewed-on: https://webrtc-review.googlesource.com/23619
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20728}
This commit is contained in:
Oskar Sundbom
2017-11-16 15:31:38 +01:00
committed by Commit Bot
parent f715c53bca
commit 12ab00b4d8
49 changed files with 435 additions and 570 deletions

View File

@ -29,11 +29,11 @@ EncodeNetEqInput::EncodeNetEqInput(std::unique_ptr<Generator> generator,
rtc::Optional<int64_t> EncodeNetEqInput::NextPacketTime() const {
RTC_DCHECK(packet_data_);
return rtc::Optional<int64_t>(static_cast<int64_t>(packet_data_->time_ms));
return static_cast<int64_t>(packet_data_->time_ms);
}
rtc::Optional<int64_t> EncodeNetEqInput::NextOutputEventTime() const {
return rtc::Optional<int64_t>(next_output_event_ms_);
return next_output_event_ms_;
}
std::unique_ptr<NetEqInput::PacketData> EncodeNetEqInput::PopPacket() {
@ -52,7 +52,7 @@ void EncodeNetEqInput::AdvanceOutputEvent() {
rtc::Optional<RTPHeader> EncodeNetEqInput::NextHeader() const {
RTC_DCHECK(packet_data_);
return rtc::Optional<RTPHeader>(packet_data_->header);
return packet_data_->header;
}
void EncodeNetEqInput::CreatePacket() {