Skip to content

android: Reset operating frame rate during flush - #8461

Merged
borongc merged 1 commit into
youtube:25.lts.1+from
borongc:seek_mediacodec
Dec 18, 2025
Merged

borongc merged 1 commit into
youtube:25.lts.1+from
borongc:seek_mediacodec

Conversation

@borongc

@borongc borongc commented Dec 18, 2025

Copy link
Copy Markdown
Member

Refer to the original PR: #8421

When the MediaCodecBridge is flushed, the previously estimated operating
frame rate becomes invalid. Resetting the frame rate estimator ensures
that new frame rate calculations start from a clean state after a flush,
preventing stale or incorrect frame rate data from affecting playback
or adaptation logic. This is important for accurate media synchronization
and performance on Android.

Issue: 467911298
Issue: 320568573

@borongc
borongc requested a review from jasonzhangxx December 18, 2025 03:40
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


android: Reset operating frame rate during flush

Flushing the MediaCodecBridge invalidates any previously estimated
operating frame rate. Resetting the frame rate estimator ensures new
calculations start from a clean state after a flush. This prevents
stale or incorrect data from affecting playback, adaptation logic,
media synchronization, and overall performance on Android.

Bug: 467911298, 320568573

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses the issue of stale frame rate data by ensuring that the mFrameRateEstimator is reset whenever the MediaCodecBridge is flushed. Placing the reset logic within a finally block guarantees that the estimator is cleared regardless of whether an exception occurs during the flush operation, which is a robust and maintainable approach. The change aligns with good programming practices for state management and resource cleanup, improving the accuracy of media synchronization and performance on Android.

@borongc
borongc enabled auto-merge (squash) December 18, 2025 10:11
@borongc
borongc merged commit 7fb995c into youtube:25.lts.1+ Dec 18, 2025
247 checks passed
@borongc
borongc deleted the seek_mediacodec branch December 19, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants