[video_player] Stop display link on dispose#11118
Merged
auto-submit[bot] merged 1 commit intoflutter:mainfrom Mar 3, 2026
Merged
[video_player] Stop display link on dispose#11118auto-submit[bot] merged 1 commit intoflutter:mainfrom
auto-submit[bot] merged 1 commit intoflutter:mainfrom
Conversation
The video player and display link won't necessarily be deallocated when the player is disposed, so the display link should be stopped at that point to avoid having it drive frame requests. Fixes flutter/flutter#181387
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where the display link might not stop after a video player is disposed. The fix correctly stops the display link within the disposeWithError: method. A new test is included to verify this behavior. The changes are sound, and I have one suggestion to enhance the robustness of the new test.
Comment on lines
+207
to
+212
| let identifiers = videoPlayerPlugin.createTexturePlayer( | ||
| with: FVPCreationOptions.make(withUri: hlsTestURI, httpHeaders: [:]), | ||
| error: &error) | ||
| #expect(error == nil) | ||
| let player = | ||
| videoPlayerPlugin.playersByIdentifier[identifiers!.playerId] as! FVPTextureBasedVideoPlayer |
There was a problem hiding this comment.
For improved test robustness, it's better to use try #require to handle the optional returned by createTexturePlayer. This ensures the test fails gracefully with a clear message if nil is returned, rather than crashing due to force-unwrapping.
Suggested change
| let identifiers = videoPlayerPlugin.createTexturePlayer( | |
| with: FVPCreationOptions.make(withUri: hlsTestURI, httpHeaders: [:]), | |
| error: &error) | |
| #expect(error == nil) | |
| let player = | |
| videoPlayerPlugin.playersByIdentifier[identifiers!.playerId] as! FVPTextureBasedVideoPlayer | |
| let identifiers = try #require(videoPlayerPlugin.createTexturePlayer( | |
| with: FVPCreationOptions.make(withUri: hlsTestURI, httpHeaders: [:]), | |
| error: &error)) | |
| #expect(error == nil) | |
| let player = | |
| videoPlayerPlugin.playersByIdentifier[identifiers.playerId] as! FVPTextureBasedVideoPlayer |
hellohuanlin
approved these changes
Mar 2, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Mar 3, 2026
github-merge-queue bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Mar 3, 2026
flutter/packages@faa4e22...9083bc9 2026-03-03 [email protected] [video_player] Stop display link on dispose (flutter/packages#11118) 2026-03-02 [email protected] Roll Flutter from 1141b2b to 46fb721 (38 revisions) (flutter/packages#11162) 2026-03-02 [email protected] [pigeon] Switch Indent class to manage all writes with a StringBuffer (flutter/packages#11133) 2026-03-02 [email protected] Add LeanCode and contributors to AUTHORS (flutter/packages#11134) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
xxxOVALxxx
pushed a commit
to xxxOVALxxx/flutter
that referenced
this pull request
Mar 10, 2026
…r#183164) flutter/packages@faa4e22...9083bc9 2026-03-03 [email protected] [video_player] Stop display link on dispose (flutter/packages#11118) 2026-03-02 [email protected] Roll Flutter from 1141b2b to 46fb721 (38 revisions) (flutter/packages#11162) 2026-03-02 [email protected] [pigeon] Switch Indent class to manage all writes with a StringBuffer (flutter/packages#11133) 2026-03-02 [email protected] Add LeanCode and contributors to AUTHORS (flutter/packages#11134) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The video player and display link won't necessarily be deallocated when the player is disposed, so the display link should be stopped at that point to avoid having it drive frame requests.
Fixes flutter/flutter#181387
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3