Skip to content

android: Reset operating frame rate during flush - #8421

Merged
borongc merged 1 commit into
youtube:mainfrom
borongc:seek_mediacodec
Dec 18, 2025
Merged

borongc merged 1 commit into
youtube:mainfrom
borongc:seek_mediacodec

Conversation

@borongc

@borongc borongc commented Dec 16, 2025 •

Copy link
Copy Markdown
Member

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 a team as a code owner December 16, 2025 03:02
@borongc
borongc requested a review from jasonzhangxx December 16, 2025 03:02
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


android: Reset operating frame rate during flush

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.

Bug: 467911298
Bug: 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 adds a call to reset the frame rate estimator when the media codec is flushed. The change is logical, as flushing the codec is a reset operation. I have one suggestion to improve the error handling to make debugging easier in case of an unexpected failure.

@borongc borongc changed the title android: reset operating frame rate during flush android: Reset operating frame rate during flush Dec 16, 2025
@borongc

borongc commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

/gemini review

@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 identifies the need to reset the frame rate estimator when the media codec is flushed. The implementation is straightforward and handles potential errors by returning an error status, which is consistent with the existing code. I have one suggestion to improve the exception handling to better align with the project's style guide by using a more specific exception type.

@borongc
borongc force-pushed the seek_mediacodec branch 2 times, most recently from dbe4890 to dddb2d0 Compare December 17, 2025 00:11
@borongc
borongc force-pushed the seek_mediacodec branch 2 times, most recently from dbe4890 to 3d2e612 Compare December 17, 2025 02:40

@yell0wd0g yell0wd0g 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.

LGTM with a suggestion.

@borongc
borongc merged commit ef8d720 into youtube:main Dec 18, 2025
632 of 636 checks passed
@borongc
borongc deleted the seek_mediacodec branch December 18, 2025 01:40
@borongc borongc added cp-25.lts.1+ Cherry Pick to the 25.lts.1+ branch cp-26.android Cherry Pick to the 26.android branch labels Dec 18, 2025
cobalt-github-releaser-bot pushed a commit that referenced this pull request Dec 18, 2025
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
(cherry picked from commit ef8d720)
johnxwork pushed a commit that referenced this pull request Dec 18, 2025
#8459)

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

Co-authored-by: Bo-Rong Chen <[email protected]>
borongc added a commit that referenced this pull request Dec 18, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cp-25.lts.1+ Cherry Pick to the 25.lts.1+ branch cp-26.android Cherry Pick to the 26.android branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants