Index: remoting/host/video_scheduler.cc |
diff --git a/remoting/host/video_scheduler.cc b/remoting/host/video_scheduler.cc |
index 7dc7f8ab3ea73d1dde8183b349a82ae113f7e88c..b9f1276c4639c953cc866baa24dd793294879f83 100644 |
--- a/remoting/host/video_scheduler.cc |
+++ b/remoting/host/video_scheduler.cc |
@@ -31,10 +31,10 @@ namespace remoting { |
// TODO(hclam): Move this value to CaptureScheduler. |
static const int kMaxPendingFrames = 2; |
-// Interval between empty keep-alive frames. These frames are sent only |
-// when there are no real video frames being sent. To prevent PseudoTCP from |
-// resetting congestion window this value must be smaller than the minimum |
-// RTO used in PseudoTCP, which is 250ms. |
+// Interval between empty keep-alive frames. These frames are sent only when the |
+// stream is paused or inactive for some other reason (e.g. when blocked on |
+// capturer). To prevent PseudoTCP from resetting congestion window this value |
+// must be smaller than the minimum RTO used in PseudoTCP, which is 250ms. |
static const int kKeepAlivePacketIntervalMs = 200; |
static bool g_enable_timestamps = false; |
@@ -374,11 +374,15 @@ void VideoScheduler::EncodeFrame( |
base::TimeTicks timestamp) { |
DCHECK(encode_task_runner_->BelongsToCurrentThread()); |
- // Drop the frame if there were no changes. |
+ // If there is nothing to encode then send an empty packet. |
if (!frame || frame->updated_region().is_empty()) { |
capture_task_runner_->DeleteSoon(FROM_HERE, frame.release()); |
- capture_task_runner_->PostTask( |
- FROM_HERE, base::Bind(&VideoScheduler::FrameCaptureCompleted, this)); |
+ scoped_ptr<VideoPacket> packet(new VideoPacket()); |
+ packet->set_client_sequence_number(sequence_number); |
+ network_task_runner_->PostTask( |
+ FROM_HERE, |
+ base::Bind( |
+ &VideoScheduler::SendVideoPacket, this, base::Passed(&packet))); |
return; |
} |