Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: media/remoting/remote_renderer_impl.cc

Issue 2638393005: Media Remoting: Exit remoting only if playback is continuously delayed. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/remoting/remote_renderer_impl.cc
diff --git a/media/remoting/remote_renderer_impl.cc b/media/remoting/remote_renderer_impl.cc
index d06c7095e4660c07be3d8d6d86d498db7d9dfc72..c4117f51b94495f27ca5410eaae84e19814bcf14 100644
--- a/media/remoting/remote_renderer_impl.cc
+++ b/media/remoting/remote_renderer_impl.cc
@@ -26,12 +26,14 @@
namespace {
// The moving time window to track the media time and statistics updates.
-constexpr base::TimeDelta kTrackingWindow = base::TimeDelta::FromSeconds(3);
+constexpr base::TimeDelta kTrackingWindow = base::TimeDelta::FromSeconds(5);
-// The allowed delay for the remoting playback. When exceeds this limit, the
-// user experience is likely poor and the controller is notified.
+// The allowed delay for the remoting playback. When exceeds this limit
+// continuously for |kMaxNumPlaybackDelayed| times, the user experience is
+// likely poor and the controller is notified.
constexpr base::TimeDelta kMediaPlaybackDelayThreshold =
- base::TimeDelta::FromMilliseconds(450);
+ base::TimeDelta::FromMilliseconds(750);
+constexpr int kMaxNumPlaybackDelayed = 3;
miu 2017/01/19 22:00:55 How about |kPlaybackDelayCountThreshold|?
xjz 2017/01/19 22:10:04 Done.
// The allowed percentage of the number of video frames dropped vs. the number
// of the video frames decoded. When exceeds this limit, the user experience is
@@ -747,8 +749,13 @@ void RemoteRendererImpl::OnMediaTimeUpdated() {
VLOG(1) << "Irregular playback detected: Media playback delayed."
<< " media_duration = " << media_duration
<< " update_duration = " << update_duration;
- OnFatalError(remoting::PACING_TOO_SLOWLY);
+ ++num_playback_delayed_;
+ if (num_playback_delayed_ == kMaxNumPlaybackDelayed)
+ OnFatalError(remoting::PACING_TOO_SLOWLY);
+ } else {
+ num_playback_delayed_ = 0;
}
+
// Prune |media_time_queue_|.
while (media_time_queue_.back().first - media_time_queue_.front().first >=
kTrackingWindow)
« media/remoting/remote_renderer_impl.h ('K') | « media/remoting/remote_renderer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698