Repository navigation
Fix audio capture never attaching when the selected source is not ready at startup - #15
Open
Poste2Travail wants to merge 28 commits into
Open
Poste2Travail wants to merge 28 commits into
Poste2Travail wants to merge 28 commits into
Conversation
Updated audio source type and added new fields for audio source name and capture check time.
Replace strncpy with memcpy for safer string copy.
…o_settings (bool)
# Conflicts: # flood-tuber.cpp
Removed unnecessary closing brace for BOUNCE effect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where Flood-tuber only looked up the selected microphone once, so if the source did not exist yet, it was never connected. The plugin now remembers the selected source name and keeps retrying until the source appears.
This also fixes MSVC build errors in
flood_tuber_update, which passed a weak source reference (obs_weak_source_t *) to APIs that expect a strongobs_source_t *.Bug
The audio source was looked up only when settings changed. If the microphone had not loaded yet (for example, a device that initializes after OBS starts), capture was never attached and the avatar never reacted to sound until the settings were changed again.
Changes
flood_tuber_try_audio_capture(): when a source name is set but not yet attached, it looks the source up by name and attaches the capture callback. It stores a weak reference and retries at most every 3 seconds.flood_tuber_remove_audio_capture(): resolves the weak reference to a strong one, removes the callback, releases the strong reference, then releases the weak reference.flood_tuber_updatestores the selected source name and calls the helpers when the selection changes or is cleared.flood_tuber_tickcallsflood_tuber_try_audio_capture()every frame, so capture attaches as soon as the source exists.flood_tuber_updatethat passed the weak reference directly to OBS APIs. It disconnected audio on every settings change, leaving a gap of up to 3 seconds.obs_get_source_by_namecall that leaked a strong source reference.Testing
Notes for reviewers
flood_tuber_updateruns on the UI thread, whileflood_tuber_tickruns on the graphics thread and also reads and writesaudio_source. Please confirm whether OBS serializes these calls for this source, or whetheraudio_sourceneeds a guard.