| Index: media/formats/webm/webm_cluster_parser.cc
|
| diff --git a/media/formats/webm/webm_cluster_parser.cc b/media/formats/webm/webm_cluster_parser.cc
|
| index 6e2424b101efc6a78fae978553bb96c21254085a..69bce49b7ec8ff06b329ec0f83ba433e447e1c74 100644
|
| --- a/media/formats/webm/webm_cluster_parser.cc
|
| +++ b/media/formats/webm/webm_cluster_parser.cc
|
| @@ -530,8 +530,18 @@ bool WebMClusterParser::Track::QueueBuffer(
|
| return false;
|
| }
|
|
|
| - estimated_next_frame_duration_ = std::max(duration,
|
| - estimated_next_frame_duration_);
|
| + // The estimated frame duration is the minimum non-zero duration since the
|
| + // last initialization segment. The minimum is used to ensure frame durations
|
| + // aren't overestimated.
|
| + if (duration > base::TimeDelta()) {
|
| + if (estimated_next_frame_duration_ == kNoTimestamp()) {
|
| + estimated_next_frame_duration_ = duration;
|
| + } else {
|
| + estimated_next_frame_duration_ =
|
| + std::min(duration, estimated_next_frame_duration_);
|
| + }
|
| + }
|
| +
|
| buffers_.push_back(buffer);
|
| return true;
|
| }
|
|
|