Index: webrtc/media/base/rtpdump.cc |
diff --git a/webrtc/media/base/rtpdump.cc b/webrtc/media/base/rtpdump.cc |
index a109f2d8e269bcfd135794a0c7847d2b8e51d79a..6ffa311cb2eb08059dcd8c2459dbc850be33e9a9 100644 |
--- a/webrtc/media/base/rtpdump.cc |
+++ b/webrtc/media/base/rtpdump.cc |
@@ -28,13 +28,12 @@ namespace cricket { |
const char RtpDumpFileHeader::kFirstLine[] = "#!rtpplay1.0 0.0.0.0/0\n"; |
-RtpDumpFileHeader::RtpDumpFileHeader(uint32_t start_ms, uint32_t s, uint16_t p) |
- : start_sec(start_ms / 1000), |
- start_usec(start_ms % 1000 * 1000), |
+RtpDumpFileHeader::RtpDumpFileHeader(int64_t start_ms, uint32_t s, uint16_t p) |
+ : start_sec(static_cast<uint32_t>(start_ms / 1000)), |
Taylor Brandstetter
2016/04/05 01:08:15
Why a uint32_t?
pthatcher1
2016/04/11 20:56:59
I agree. Why not just change to uint64_t everywhe
honghaiz3
2016/04/18 23:39:04
RtpDumpFileHeader defines the format of the RtpDum
|
+ start_usec(static_cast<uint32_t>(start_ms % 1000 * 1000)), |
source(s), |
port(p), |
- padding(0) { |
-} |
+ padding(0) {} |
void RtpDumpFileHeader::WriteToByteBuffer(rtc::ByteBufferWriter* buf) { |
buf->WriteUInt32(start_sec); |
@@ -44,7 +43,7 @@ void RtpDumpFileHeader::WriteToByteBuffer(rtc::ByteBufferWriter* buf) { |
buf->WriteUInt16(padding); |
} |
-static const uint32_t kDefaultTimeIncrease = 30; |
+static const int kDefaultTimeIncrease = 30; |
bool RtpDumpPacket::IsValidRtpPacket() const { |
return original_data_len >= data.size() && |
@@ -315,7 +314,7 @@ void RtpDumpWriter::set_packet_filter(int filter) { |
} |
uint32_t RtpDumpWriter::GetElapsedTime() const { |
- return rtc::TimeSince(start_time_ms_); |
+ return static_cast<uint32_t>(rtc::Time() - start_time_ms_); |
} |
rtc::StreamResult RtpDumpWriter::WriteFileHeader() { |
@@ -395,10 +394,10 @@ size_t RtpDumpWriter::FilterPacket(const void* data, size_t data_len, |
rtc::StreamResult RtpDumpWriter::WriteToStream( |
const void* data, size_t data_len) { |
- uint32_t before = rtc::Time(); |
+ int64_t before = rtc::Time(); |
rtc::StreamResult result = |
stream_->WriteAll(data, data_len, NULL, NULL); |
- uint32_t delay = rtc::TimeSince(before); |
+ uint32_t delay = static_cast<uint32_t>(rtc::TimeSince(before)); |
if (delay >= warn_slow_writes_delay_) { |
LOG(LS_WARNING) << "Slow RtpDump: took " << delay << "ms to write " |
<< data_len << " bytes."; |