}
if (status != kBufferNone) {
- if (GetOperationForData() == OperationForData::PLAY)
+ if (GetOperationForData() == OperationForData::PLAY) {
ReportBufferingStateIfNeeded(BUFFERING_HAVE_ENOUGH,
BUFFERING_CHANGE_REASON_UNKNOWN);
+ }
} else {
ReportBufferingStateIfNeeded(BUFFERING_HAVE_NOTHING,
BUFFERING_CHANGE_REASON_UNKNOWN);
OperationForData operation = GetOperationForData();
switch (operation) {
case OperationForData::PLAY:
+ ReportBufferingStateIfNeeded(BUFFERING_HAVE_ENOUGH,
+ BUFFERING_CHANGE_REASON_UNKNOWN);
is_paused_by_buffering_ = false;
Play();
break;
case OperationForData::PAUSE:
+ ReportBufferingStateIfNeeded(BUFFERING_HAVE_NOTHING,
+ BUFFERING_CHANGE_REASON_UNKNOWN);
is_paused_by_buffering_ = true;
Pause(true);
break;
// If data has been pushed enough (>= kMinWaitTimeForPlayback)
if (time_diff >= kMinWaitTimeForPlayback) {
LOG(INFO) << __func__ << " Data is enough to play,";
- ReportBufferingStateIfNeeded(BUFFERING_HAVE_ENOUGH,
- BUFFERING_CHANGE_REASON_UNKNOWN);
return OperationForData::PLAY;
}
} else {
if (should_pause) {
LOG(INFO) << __func__ << " Not enough data to play.";
- // If pushing pts smaller than current_position, should report
- // BUFFERING_HAVE_NOTHING to replace BUFFERING_HAVE_ENOUGH
- ReportBufferingStateIfNeeded(BUFFERING_HAVE_NOTHING,
- BUFFERING_CHANGE_REASON_UNKNOWN);
return OperationForData::PAUSE;
}
}
video_plane_controller_->ApplyDeferredVideoRectIfNeeded();
#endif
+ ReportBufferingStateIfNeeded(BUFFERING_HAVE_ENOUGH,
+ BUFFERING_CHANGE_REASON_UNKNOWN);
+
is_prepared_ = true;
is_preparing_ = false;
if (pending_seek_) {
LOG(INFO) << "(" << static_cast<void*>(this) << ") " << __func__
<< " is_paused:" << is_paused_;
+ ReportBufferingStateIfNeeded(BUFFERING_HAVE_ENOUGH,
+ BUFFERING_CHANGE_REASON_UNKNOWN);
+
current_position_ = seek_position_;
is_seeking_ = false;
expected_seek_ = false;