Chromium Code Reviews| Index: media/blink/webmediaplayer_impl.cc |
| diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc |
| index a5587443b1e35a02a729b2098acbc131adcff7c3..c035e5ea7136976a2ce7510d04e116daf3b17973 100644 |
| --- a/media/blink/webmediaplayer_impl.cc |
| +++ b/media/blink/webmediaplayer_impl.cc |
| @@ -1136,17 +1136,20 @@ void WebMediaPlayerImpl::OnBufferingStateChange(BufferingState state) { |
| } else { |
| // Buffering has underflowed. |
| DCHECK_EQ(state, BUFFERING_HAVE_NOTHING); |
| - // It shouldn't be possible to underflow if we've not advanced past |
| - // HAVE_CURRENT_DATA. |
| - DCHECK_GT(highest_ready_state_, WebMediaPlayer::ReadyStateHaveCurrentData); |
| - SetReadyState(WebMediaPlayer::ReadyStateHaveCurrentData); |
| // Report the number of times we've entered the underflow state. Only report |
| - // for src= playback since for MSE it's out of our control. |
| - if (data_source_) { |
| + // for src= playback since for MSE it's out of our control. Ensure we only |
| + // report the value when transitioning from HAVE_ENOUGH to HAVE_NOTHING. |
| + if (data_source_ && |
| + ready_state_ == WebMediaPlayer::ReadyStateHaveEnoughData) { |
|
chcunningham
2016/09/09 21:27:05
I think this is fine, but I'm not sure it will hav
DaleCurtis
2016/09/09 21:51:41
Correct, that was my interpretation, but I wasn't
|
| UMA_HISTOGRAM_COUNTS_100("Media.UnderflowCount", ++underflow_count_); |
| underflow_timer_.reset(new base::ElapsedTimer()); |
| } |
| + |
| + // It shouldn't be possible to underflow if we've not advanced past |
| + // HAVE_CURRENT_DATA. |
| + DCHECK_GT(highest_ready_state_, WebMediaPlayer::ReadyStateHaveCurrentData); |
| + SetReadyState(WebMediaPlayer::ReadyStateHaveCurrentData); |
| } |
| UpdatePlayState(); |