8000 Fix Quit after welcome window triggers crash, #4343 by low-batt · Pull Request #4356 · iina/iina · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Quit after welcome window triggers crash, #4343 #4356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2023
Merged

Conversation

low-batt
Copy link
Contributor
@low-batt low-batt commented Apr 16, 2023

This commit will:

  • Remove the incorrect fix added to PlayerCore.shutdown for issue Crash in mpv_render_context_report_swap while quitting #4315
  • Add the Atomic property wrapper to the VideoView.isUninited property
  • Change VideoView.uninit to hold a lock on isUninited when executing
  • Change VideoView.displayLinkCallback to hold a lock on isUninited when executing
  • Change ViewLayer.draw to to hold a lock on isUninited as needed
  • Change ViewLayer.display to to hold a lock on isUninited as needd
  • Remove the Atomic property wrapper from the ViewLayer properties forceRender and needsMPVRender
  • Move the method onVideoReconfig from MPVController to PlayerCore
  • Change the onVideoReconfig method to check for shutdown

These changes:


Description:

This commit will:
- Remove the incorrect fix added to PlayerCore.shutdown for issue #4315
- Add the Atomic property wrapper to the VideoView.isUninited property
- Change VideoView.uninit to hold a lock on isUninited when executing
- Change VideoView.displayLinkCallback to hold a lock on isUninited when
  executing
- Change VideoLayer.draw to to hold a lock on isUninited as needed
- Change VideoLayer.display to to hold a lock on isUninited as needd
- Remove the Atomic property wrapper from the VideoLayer properties
  forceRender and needsMPVRender
- Move the method onVideoReconfig from MPVController to PlayerCore
- Change the onVideoReconfig method to check for shutdown

These changes:
- Correct issue #4343 by removing the faulty fix for issue #4315
- Correct issue #4315 by coordinating threads during the shutdown of
  VideoView
- Correct a crash due to onVideoReconfig accessing the mpv core during
  shutdown
@low-batt low-batt linked an issue Apr 16, 2023 that may be closed by this pull request
1 task
This commit will:
- Remove the incorrect fix added to PlayerCore.shutdown for issue #4315
- Add the Atomic property wrapper to the VideoView.isUninited property
- Change VideoView.uninit to hold a lock on isUninited when executing
- Change VideoView.displayLinkCallback to hold a lock on isUninited when
  executing
- Change ViewLayer.draw to to hold a lock on isUninited as needed
- Change ViewLayer.display to to hold a lock on isUninited as needed
- Remove the Atomic property wrapper from the ViewLayer properties
  forceRender and needsMPVRender
- Move the method onVideoReconfig from MPVController to PlayerCore
- Change the onVideoReconfig method to check for shutdown

These changes:
- Correct issue #4343 by removing the faulty fix for issue #4315
- Correct issue #4315 by coordinating threads during the shutdown of
  VideoView
- Correct a crash due to onVideoReconfig accessing the mpv core during
  shutdown
@low-batt
Copy link
Contributor Author

This PR is adding locking to make shutdown of VideoView deterministic. This code was already acquiring a lock on the OpenGL context. This means adding a second lock poses the danger of a deadlock if the locks are not acquired consistently in the same order. I believe that is being done correctly, but reviewers should confirm locking order is consistent.

As this involves the critical VideoView and ViewLayer classes it needs a detailed review.

@low-batt low-batt requested a review from uiryuu April 16, 2023 19:59
@uiryuu uiryuu mentioned this pull request Apr 22, 2023
23 tasks
@uiryuu uiryuu merged commit d13c3f0 into develop Apr 22, 2023
@uiryuu uiryuu deleted the fix-4343 branch April 22, 2023 12:50
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.

Quit after welcome window displayed triggers crash
2 participants
0