Skip to content

Conversation

cgutman
Copy link
Collaborator

@cgutman cgutman commented Jan 5, 2023

Description

Rework encoder selection logic to avoid terminating Sunshine if the preferred encoder is not available or doesn't meet the HDR requirement selected. This ensures it's not possible to accidentally set an encoder that's not supported on your system and prevent Sunshine from starting again without manual config file modification.

The old logic was:

  1. If a specific encoder is requested, use that encoder. If that encoder doesn't pass validation or doesn't support HDR when requested, fail to start.
  2. If an encoder with HDR support is requested and passes validation, use that encoder. If no encoder with HDR support is available, fail to start.
  3. If no specific encoder was requested and HDR encoding was not required, use the first working encoder.
  4. Else, fail to start.

The new logic is:

  1. If a specific encoder is requested and that encoder passes validation, use the specified encoder.
  2. If an encoder with HDR support is requested and one is available, use the first working encoder with HDR support.
  3. If any encoder passes validation, use the first working encoder.
  4. Else, fail to start.

I also made a small fix for #692 based on testing with libx265 during this work. libx265 encoding still has issues but this makes it much better (and restores pre-#692 levels of functionality).

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

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