Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions libobs/obs-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -6613,3 +6613,17 @@ void streamlabs_force_source_ui_refresh(obs_source_t *source)
// 'updateSourceFlags' in desktop repo
source->info.output_flags ^= CUSTOM_REFRESH_UI_FLAG;
}

void streamlabs_set_audio_flag(obs_source_t *source, bool isAudio)
{
//game_capture sources have the option of being an audio source - the default is to include the flag
//which causes volmeters to show for game_capture sources that are NOT audio sources so we need to
//be able to toggle the flag
if (isAudio != is_audio_source(source)) {
if (!isAudio) {
source->info.output_flags &= ~OBS_SOURCE_AUDIO;
} else {
source->info.output_flags |= OBS_SOURCE_AUDIO;
}
}
}
1 change: 1 addition & 0 deletions libobs/obs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ EXPORT void obs_source_restore_filters(obs_source_t *source,

/** Custom function to force source-related UI refresh from inside OBS */
EXPORT void streamlabs_force_source_ui_refresh(obs_source_t *source);
EXPORT void streamlabs_set_audio_flag(obs_source_t *source, bool isAudio);

/* ------------------------------------------------------------------------- */
/* Functions used by sources */
Expand Down
7 changes: 7 additions & 0 deletions plugins/win-capture/game-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,13 @@ static void game_capture_update(void *data, obs_data_t *settings)
gc->initial_config = false;
}


//make sure the source's output flags are set correctly - they default to
//game_capture being an audio source, if this box isn't checked we need
//to make sure the output flags don't include OBS_SOURCE_AUDIO or else
//the FE will create a volmeter for a non-audio game_capture
streamlabs_set_audio_flag(gc->source, gc->config.capture_audio);

/* Linked audio capture source stuff */
setup_audio_source(gc->source, &gc->audio_source,
cfg.mode == CAPTURE_MODE_WINDOW ? window : NULL,
Expand Down