Cherry pick PR #807: [android] Reset frame rate estimator when the stream fps changed (#807) #1062
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry pick PR #807: [android] Reset frame rate estimator when the stream fps changed (#807)
Refer to the original PR: #807
When playing a stream, the key operating rate is set to MediaCodec for resource planning. It's calculated by the playback rate and the estimated fps. While the latter is calculated by the number of rendered frames in duration. When the stream fps is changed, the estimated fps will be affected by the frames already rendered with the old fps and slowly adjusted to the new fps. This may lead to insufficient resources prepared for the stream and cause some performance issues.
b/290409989
Change-Id: I5126794d0ac98d29fc8405359bcb4f62dc444308