libobs: Remove redundant function param and for loop
Originally when the audio_submix function was created, it used all mixer tracks, but at a certain point that was removed because it can only use the first track, so some older code was unintentionally left over, causing the same code to be executed 6 times mistakenly. This cleans that up by removing the unnecessary function parameter and for loop.master
parent
1a72b04951
commit
23111c317f
|
@ -4358,7 +4358,7 @@ static void custom_audio_render(obs_source_t *source, uint32_t mixers,
|
|||
apply_audio_volume(source, mixers, channels, sample_rate);
|
||||
}
|
||||
|
||||
static void audio_submix(obs_source_t *source, uint32_t mixers, size_t channels,
|
||||
static void audio_submix(obs_source_t *source, size_t channels,
|
||||
size_t sample_rate)
|
||||
{
|
||||
struct audio_output_data audio_data;
|
||||
|
@ -4366,15 +4366,13 @@ static void audio_submix(obs_source_t *source, uint32_t mixers, size_t channels,
|
|||
bool success;
|
||||
uint64_t ts;
|
||||
|
||||
for (size_t mix = 0; mix < MAX_AUDIO_MIXES; mix++) {
|
||||
for (size_t ch = 0; ch < channels; ch++) {
|
||||
audio_data.data[ch] = source->audio_mix_buf[ch];
|
||||
}
|
||||
|
||||
memset(source->audio_mix_buf[0], 0,
|
||||
sizeof(float) * AUDIO_OUTPUT_FRAMES * channels);
|
||||
for (size_t ch = 0; ch < channels; ch++) {
|
||||
audio_data.data[ch] = source->audio_mix_buf[ch];
|
||||
}
|
||||
|
||||
memset(source->audio_mix_buf[0], 0,
|
||||
sizeof(float) * AUDIO_OUTPUT_FRAMES * channels);
|
||||
|
||||
success = source->info.audio_mix(source->context.data, &ts, &audio_data,
|
||||
channels, sample_rate);
|
||||
|
||||
|
@ -4462,7 +4460,7 @@ void obs_source_audio_render(obs_source_t *source, uint32_t mixers,
|
|||
}
|
||||
|
||||
if (source->info.audio_mix) {
|
||||
audio_submix(source, mixers, channels, sample_rate);
|
||||
audio_submix(source, channels, sample_rate);
|
||||
}
|
||||
|
||||
if (!source->audio_ts) {
|
||||
|
|
Loading…
Reference in New Issue