Prechádzať zdrojové kódy

libobs: Respect push to talk/mute status in volmeter

The audio capture callback's mute parameter internally respects the
push to talk/mute state, whereas obs_source_muted() and the "mute"
signal don't. This resulted in meters looking entirely unmuted even
though both monitoring and output were not receiving audio.
Matt Gajownik 3 rokov pred
rodič
commit
67dbb316a5
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      libobs/obs-audio-controls.c

+ 2 - 2
libobs/obs-audio-controls.c

@@ -535,7 +535,8 @@ static void volmeter_source_data_received(void *vptr, obs_source_t *source,
 
 	// Adjust magnitude/peak based on the volume level set by the user.
 	// And convert to dB.
-	mul = db_to_mul(volmeter->cur_db);
+	mul = muted && !obs_source_muted(source) ? 0.0f
+						 : db_to_mul(volmeter->cur_db);
 	for (int channel_nr = 0; channel_nr < MAX_AUDIO_CHANNELS;
 	     channel_nr++) {
 		magnitude[channel_nr] =
@@ -552,7 +553,6 @@ static void volmeter_source_data_received(void *vptr, obs_source_t *source,
 	signal_levels_updated(volmeter, magnitude, peak, input_peak);
 
 	UNUSED_PARAMETER(source);
-	UNUSED_PARAMETER(muted);
 }
 
 obs_fader_t *obs_fader_create(enum obs_fader_type type)