Skip to content

Conversation

cgutman
Copy link
Collaborator

@cgutman cgutman commented Jan 5, 2023

Description

While testing with #707, I discovered an issue that was causing stream termination hangs that would prevent a client from reconnecting (or with #707, cause Sunshine to terminate itself). The issue is that the only time display_t::capture() will return to the capture thread or invoke the callback is when a frame is successfully captured or an error or reinit occurs. If it's just a normal timeout, the capture function will loop forever trying to capture a frame.

To fix this, I added a parameter to the snapshot_cb callback that indicates whether a frame was captured or if this is a callback invocation caused by a timeout. Now that snapshot_cb is being invoked for timeouts, it can check if capture should stop and return nullptr to indicate that.

Screenshot

Issues Fixed or Closed

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

@ReenigneArcher ReenigneArcher merged commit 00aa23b into LizardByte:nightly Jan 5, 2023
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