libobs: Various fixes for monitoring deduplication #12671
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.
Description
This fixes several bugs reported in audio-support and dev channels of our Discord server.
Motivation and Context
Fixes 3 bugs.
Bugs reported by @Penwy & @prgmitchell
Bug 1 fix:
If the AOC has, say, tracks 1 2 3 enabled but not 4 5 6, and the monitored source has tracks 2 & 5 enabled,
the duplication occurs only on track 2.
So the silencing should occur on track 2 but not the others (track 5 in the example).
The bug fix checks then which tracks are common to AOC and monitored source and silences only them.
Bug 2 fix:
we allow for a looser device id match on linux by strncmp in addition to strcmp.
Bug3 fix:
we add a fader_muted member of obs_source; it is set to false unless the fader cur_db is below min_db.
The deduplication logic is now bypassed whenever the Desktop Audio is either user_muted or fader_muted.
How Has This Been Tested?
Bug 1: Checked by breakpointing that the silencing did not occur any more for tracks which are not common to both AOC
and monitored source.
Bug 2 : not checked. Waiting for linux testers.
Bug 3: Checked by making a recording. The monitored source set to monitoriand_and_output was still heard in the recording even though the desktop audio fader was at minimum.
Types of changes
Checklist: