obsproject / obsproject/obs-studio

Starting virtual cam in plugin event - crash in OBSBasic::OnActivate

Open
#6,810 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

platform/windows
Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

Git

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/koUQNSzx30YPoS2j

OBS Studio Crash Log URL

https://obsproject.com/logs/SXXplF23W55-lQEi

Expected Behavior

Virtual camera should be activated if it wasn't already.

Current Behavior

Obs crashes in function TaskbarOverlaySetStatus() at line taskBtn->setOverlayIcon() because taskBtn is null.

Steps to Reproduce
  1. Create plugin.
  2. On OBS_FRONTEND_EVENT_SCENE_CHANGED event call obs_frontend_start_virtualcam()
  3. Run obs
Anything else we should know?

I have made some modifications to obs so lines or address may be shifted. But nothing that could have impacted the camera.
If I "jump" over the first event trigger by adding a variable first_run (which is set after the first SCENE_CHANGED is triggered) then the call to obs_frontend_start_virtualcam() succeeds on all subsequent events.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with OBSBasic::OnActivate and TaskbarOverlaySetStatus(), then trace the OBS_FRONTEND_EVENT_SCENE_CHANGED path that calls obs_frontend_start_virtualcam(). Review the linked log and crash log to confirm the null taskBtn condition. Done means starting the virtual camera from the plugin event no longer crashes OBS when it is inactive.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.