| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 } | 982 } |
| 983 #else | 983 #else |
| 984 paused_time_ = pipeline_.GetMediaTime(); | 984 paused_time_ = pipeline_.GetMediaTime(); |
| 985 #endif | 985 #endif |
| 986 } else { | 986 } else { |
| 987 DCHECK(watch_time_reporter_); | 987 DCHECK(watch_time_reporter_); |
| 988 watch_time_reporter_->OnPlaying(); | 988 watch_time_reporter_->OnPlaying(); |
| 989 } | 989 } |
| 990 if (time_updated) | 990 if (time_updated) |
| 991 should_notify_time_changed_ = true; | 991 should_notify_time_changed_ = true; |
| 992 |
| 993 // Reset underflow count upon seek; this prevents looping videos and user |
| 994 // actions from artificially inflating the underflow count. |
| 995 underflow_count_ = 0; |
| 992 } | 996 } |
| 993 | 997 |
| 994 void WebMediaPlayerImpl::OnPipelineSuspended() { | 998 void WebMediaPlayerImpl::OnPipelineSuspended() { |
| 995 #if defined(OS_ANDROID) | 999 #if defined(OS_ANDROID) |
| 996 if (isRemote()) { | 1000 if (isRemote()) { |
| 997 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); | 1001 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); |
| 998 if (frame) | 1002 if (frame) |
| 999 compositor_->PaintSingleFrame(frame); | 1003 compositor_->PaintSingleFrame(frame); |
| 1000 } | 1004 } |
| 1001 #endif | 1005 #endif |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 pipeline_metadata_.natural_size, | 1814 pipeline_metadata_.natural_size, |
| 1811 base::Bind(&GetCurrentTimeInternal, this))); | 1815 base::Bind(&GetCurrentTimeInternal, this))); |
| 1812 watch_time_reporter_->OnVolumeChange(volume_); | 1816 watch_time_reporter_->OnVolumeChange(volume_); |
| 1813 if (delegate_ && delegate_->IsHidden()) | 1817 if (delegate_ && delegate_->IsHidden()) |
| 1814 watch_time_reporter_->OnHidden(); | 1818 watch_time_reporter_->OnHidden(); |
| 1815 else | 1819 else |
| 1816 watch_time_reporter_->OnShown(); | 1820 watch_time_reporter_->OnShown(); |
| 1817 } | 1821 } |
| 1818 | 1822 |
| 1819 } // namespace media | 1823 } // namespace media |
| OLD | NEW |