Skip to content

Handle missing Decklink hardware when drivers are installed#238

Merged
tedwaine merged 1 commit intoAcademySoftwareFoundation:mainfrom
xShirae:fix/decklink-no-device-crash
Mar 30, 2026
Merged

Handle missing Decklink hardware when drivers are installed#238
tedwaine merged 1 commit intoAcademySoftwareFoundation:mainfrom
xShirae:fix/decklink-no-device-crash

Conversation

@xShirae
Copy link
Copy Markdown
Contributor

@xShirae xShirae commented Mar 30, 2026

This fixes a crash that occurs when Blackmagic DeckLink drivers are present but no DeckLink hardware is attached.

Problem
The plugin currently checks for DeckLink driver presence, but not whether a usable DeckLink output device was actually
initialised. DecklinkOutput::init_decklink() can fail and leave decklink_output_interface_ null, while the plugin
still logs Decklink Card Initialised and still creates the DeckLink audio output path. Playback later crashes when the
audio path calls DecklinkOutput::num_samples_in_buffer().

What changed

  • Added an explicit availability state to DecklinkOutput.
  • BMDecklinkPlugin::initialise() now exits early when drivers are present but no DeckLink device is available.
  • BMDecklinkPlugin::make_audio_output_device() now returns nullptr unless DeckLink output is actually available, so
    the DeckLink audio actor is not spawned in the invalid state.
  • Added null guards around low-level DeckLink audio/output interface calls so missing interfaces fail safely instead
    of crashing.

Result
With DeckLink drivers installed but no hardware connected:

  • xStudio starts normally.
  • The DeckLink plugin is marked unavailable/error instead of being treated as initialised.
  • The DeckLink audio path is not created.
    Reproduction
  1. Install DeckLink drivers.
  2. Disconnect / do not attach DeckLink hardware.
  3. Launch xStudio.
  4. Load media or start playback.

Before this change:

  • plugin logs Decklink Card Initialised
  • later crashes in DecklinkOutput::num_samples_in_buffer()

After this change:

  • plugin reports no device available
  • xStudio remains usable

Signed-off-by: xShirae <xshiraayuki@gmail.com>
@xShirae xShirae force-pushed the fix/decklink-no-device-crash branch from 631cc2e to 08c8363 Compare March 30, 2026 16:22
@tedwaine tedwaine merged commit cf8902f into AcademySoftwareFoundation:main Mar 30, 2026
2 checks passed
@tedwaine
Copy link
Copy Markdown
Contributor

Thank you!

tedwaine pushed a commit that referenced this pull request Mar 30, 2026
Signed-off-by: xShirae <xshiraayuki@gmail.com>
Signed-off-by: Ted Waine <ted.waine@gmail.com>
tedwaine added a commit that referenced this pull request Mar 30, 2026
* Add numpy to pip installed packages

Signed-off-by: Ted Waine <ted.waine@gmail.com>

* Tweak for set video range action

Signed-off-by: Ted Waine <ted.waine@gmail.com>

* Handle missing Decklink hardware when drivers are installed (#238)

Signed-off-by: xShirae <xshiraayuki@gmail.com>
Signed-off-by: Ted Waine <ted.waine@gmail.com>

---------

Signed-off-by: Ted Waine <ted.waine@gmail.com>
Signed-off-by: xShirae <xshiraayuki@gmail.com>
Co-authored-by: xShirae <83482842+xShirae@users.noreply.github.com>
@xShirae xShirae deleted the fix/decklink-no-device-crash branch April 1, 2026 10:02
richardssam pushed a commit to richardssam/xstudio that referenced this pull request Apr 2, 2026
…oftwareFoundation#238)

Signed-off-by: xShirae <xshiraayuki@gmail.com>
Signed-off-by: Ted Waine <ted.waine@gmail.com>
Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>
jhery-rdo pushed a commit to jhery-rdo/xstudio that referenced this pull request Apr 16, 2026
Brings in rdo_media_loader, media_hook_rodeo, and annotation
onion skin plugins. DeckLink conflicts resolved by keeping our
version from PR AcademySoftwareFoundation#238.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jhery-rdo pushed a commit to jhery-rdo/xstudio that referenced this pull request Apr 22, 2026
…on#238)

Reset src/plugin/video_output/bmd_decklink/ to the state at commit
0a90eea "Handle missing Decklink hardware when drivers are installed
(AcademySoftwareFoundation#238)". This reverts:

- the null-safety/is_available defensive checks in decklink_plugin.cpp
  that were added on top of the feat branch
- the Linux BMD driver ABI fallback additions in DeckLinkAPIDispatch.cpp

Also supersedes 1144677 (minimal last_error fix) by a wholesale reset,
since 0a90eea's plugin.cpp has a different design that calls
DecklinkOutput::check_decklink_installation() in the constructor and
throws if the drivers aren't available.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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