Skip to content

Conversation

@psyke83
Copy link
Contributor

@psyke83 psyke83 commented Jan 24, 2023

Description

When a reinit caused by a capture size change occurs via the Windows hardware encoder, the stream will freeze with display_wp->use_count() stuck at 2. Fix by ensuring pending images are freed before reinit event is checked.

To reproduce:

  • Using an application that allows full-screen transition via alt-enter, continually enter and exit fullscreen whilst the application is configured to use a different resolution from the desktop. In my case, I used Sonic Mania @ 1360x768 with a desktop resolution of 1440p, and the freeze usually occurs within 10 successive resolution changes.
  • Disabling DwmFlush appears to help reproduce the issue more quickly.

The freeze will occur when this line appears in the log:

[2023:01:24:02:01:26]: Info: Capture size changed [1360x768 -> 2560x1440]

Further debugging shows that display_wp->use_count() stays at 2, causing Sunshine to freeze as it is stuck in this loop.

Pinging @cgutman, as it is related to: adbfd09. Please let me know if moving this breaks the original case it was intended to fix.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

When a reinit caused by a capture size change occurs via the
Windows hardware encoder, the stream will freeze with
display_wp->use_count() stuck at 2. Fix by ensuring pending images
are freed before reinit event is checked.
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.

3 participants