Revert 3876

Review URL: https://webrtc-codereview.appspot.com/1341005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3877 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org 2013-04-19 21:11:41 +00:00
parent ee184b9520
commit e0e029e8cb

View File

@ -145,6 +145,12 @@ int32_t VCMReceiver::InsertPacket(const VCMPacket& packet,
"First packet of frame %u at %u", packet.timestamp,
MaskWord64ToUWord32(now_ms));
}
render_time_ms = timing_->RenderTimeMs(packet.timestamp, now_ms);
if (render_time_ms >= 0) {
buffer->SetRenderTime(render_time_ms);
} else {
buffer->SetRenderTime(now_ms);
}
}
// Insert packet into the jitter buffer both media and empty packets.
@ -181,11 +187,11 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding(
// No timestamp in jitter buffer at the moment.
return NULL;
}
const uint32_t time_stamp = static_cast<uint32_t>(ret);
// Update the timing.
timing_->SetRequiredDelay(jitter_buffer_.EstimatedJitterMs());
timing_->UpdateCurrentDelay(ret);
const int64_t now_ms = clock_->TimeInMilliseconds();
next_render_time_ms = timing_->RenderTimeMs(ret, now_ms);
timing_->UpdateCurrentDelay(time_stamp);
const int32_t temp_wait_time = max_wait_time_ms -
static_cast<int32_t>(clock_->TimeInMilliseconds() - start_time_ms);
@ -203,15 +209,6 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding(
}
if (frame != NULL) {
// Set render time.
const int64_t now_ms = clock_->TimeInMilliseconds();
const int64_t render_time_ms = timing_->RenderTimeMs(frame->TimeStamp(),
now_ms);
if (render_time_ms >= 0) {
frame->SetRenderTime(render_time_ms);
} else {
frame->SetRenderTime(now_ms);
}
bool retransmitted = false;
const int64_t last_packet_time_ms =
jitter_buffer_.LastPacketTime(frame, &retransmitted);
@ -219,7 +216,7 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding(
// We don't want to include timestamps which have suffered from
// retransmission here, since we compensate with extra retransmission
// delay within the jitter estimate.
timing_->IncomingTimestamp(frame->TimeStamp(), last_packet_time_ms);
timing_->IncomingTimestamp(time_stamp, last_packet_time_ms);
}
if (dual_receiver != NULL) {
dual_receiver->UpdateState(*frame);