Skip to content

Commit

Permalink
fix vertical audio exclusion (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
summeroff authored Feb 20, 2025
1 parent e4f90f5 commit c1cb23e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
10 changes: 6 additions & 4 deletions libobs/obs-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,19 @@ static void mix_audio(struct audio_data_mixes_outputs *mixes,
}
for (size_t canvas_idx = 0; canvas_idx < mixes->outputs.num;
canvas_idx++) {
size_t active_canvas_idx =
source->info.audio_render ? canvas_idx : 0;

for (size_t mix_idx = 0; mix_idx < MAX_AUDIO_MIXES; mix_idx++) {
for (size_t ch = 0; ch < channels; ch++) {
register float *mix =
mixes->outputs.array[canvas_idx]
.output[mix_idx]
.data[ch];
register float *aud =
get_source_audio_output_buf(source,
canvas_idx,
mix_idx,
ch);
get_source_audio_output_buf(
source, active_canvas_idx,
mix_idx, ch);
if (!aud) {
continue;
}
Expand Down
3 changes: 0 additions & 3 deletions libobs/obs-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -5990,9 +5990,6 @@ void obs_source_audio_render(obs_source_t *source, uint32_t mixers,
{
if (!get_source_audio_output_buf(source, 0, 0, 0)) {
source->audio_pending = true;
blog(LOG_INFO,
"[AUDIO_CANVAS] obs_source_audio_render audio_output_buf is NULL for source %s",
source->context.name);
return;
}

Expand Down
10 changes: 2 additions & 8 deletions libobs/obs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2762,10 +2762,7 @@ void obs_set_audio_rendering_canvas(struct obs_video_info *ovi)

struct obs_video_info *obs_get_audio_rendering_canvas(void)
{
if (!obs)
return NULL;
else
return obs->audio_rendering_canvas;
return obs ? obs->audio_rendering_canvas : NULL;
}

void obs_set_video_rendering_canvas(struct obs_video_info *ovi)
Expand All @@ -2778,10 +2775,7 @@ void obs_set_video_rendering_canvas(struct obs_video_info *ovi)

struct obs_video_info *obs_get_video_rendering_canvas(void)
{
if (!obs)
return NULL;
else
return obs->video_rendering_canvas;
return obs ? obs->video_rendering_canvas : NULL;
}

void obs_set_replay_buffer_rendering_mode(
Expand Down

0 comments on commit c1cb23e

Please sign in to comment.