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

Unified Diff: media/remoting/remote_renderer_impl.cc

Issue 2638393005: Media Remoting: Exit remoting only if playback is continuously delayed. (Closed)
Patch Set: Addressed comments. 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
« no previous file with comments | « media/remoting/remote_renderer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f90ed1858ebad0b4b0b17b322a8648b9ad77ca95 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 continuously exceeds this
+// limit for |kPlaybackDelayCountThreshold| 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 kPlaybackDelayCountThreshold = 3;
// 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);
+ ++times_playback_delayed_;
+ if (times_playback_delayed_ == kPlaybackDelayCountThreshold)
+ OnFatalError(remoting::PACING_TOO_SLOWLY);
+ } else {
+ times_playback_delayed_ = 0;
}
+
// Prune |media_time_queue_|.
while (media_time_queue_.back().first - media_time_queue_.front().first >=
kTrackingWindow)
« no previous file with comments | « media/remoting/remote_renderer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698