Optional: Use nullopt and implicit construction in /modules/video_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.

Bug: None
Change-Id: Iedebf4dc56a973306e7d7e7649525879808dc72b
Reviewed-on: https://webrtc-review.googlesource.com/23578
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20878}
This commit is contained in:
Oskar Sundbom
2017-11-16 10:54:49 +01:00
committed by Commit Bot
parent 56d460902e
commit 6bd39025ec
9 changed files with 17 additions and 20 deletions

View File

@ -116,9 +116,9 @@ bool PacketBuffer::InsertPacket(VCMPacket* packet) {
UpdateMissingPackets(packet->seqNum);
int64_t now_ms = clock_->TimeInMilliseconds();
last_received_packet_ms_ = rtc::Optional<int64_t>(now_ms);
last_received_packet_ms_ = now_ms;
if (packet->frameType == kVideoFrameKey)
last_received_keyframe_packet_ms_ = rtc::Optional<int64_t>(now_ms);
last_received_keyframe_packet_ms_ = now_ms;
found_frames = FindFrames(seq_num);
}
@ -458,7 +458,7 @@ int PacketBuffer::Release() const {
void PacketBuffer::UpdateMissingPackets(uint16_t seq_num) {
if (!newest_inserted_seq_num_)
newest_inserted_seq_num_ = rtc::Optional<uint16_t>(seq_num);
newest_inserted_seq_num_ = seq_num;
const int kMaxPaddingAge = 1000;
if (AheadOf(seq_num, *newest_inserted_seq_num_)) {