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}
diff --git a/modules/video_coding/packet_buffer.cc b/modules/video_coding/packet_buffer.cc
index bf83083..9b3d93e 100644
--- a/modules/video_coding/packet_buffer.cc
+++ b/modules/video_coding/packet_buffer.cc
@@ -116,9 +116,9 @@
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 @@
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_)) {