Skip to content

Commit

Permalink
fixed swittcher when :excl_init is used
Browse files Browse the repository at this point in the history
\+ fixed device names not being stored except first device with excl_init

see also commit a24e194 fixing the issue without that option

refers to GH-336
  • Loading branch information
MartinPulec committed Sep 15, 2023
1 parent ee1d614 commit a2d3eb8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/video_capture/switcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ vidcap_switcher_init(struct vidcap_params *params, void **state)
vidcap_params_get_fmt(tmp));
goto error;
}
snprintf(s->device_names[i], sizeof s->device_names[i], "%s%s%s", vidcap_params_get_driver(tmp),
strlen(vidcap_params_get_fmt(tmp)) > 0 ? ":" : "", vidcap_params_get_fmt(tmp));
}
snprintf(s->device_names[i], sizeof s->device_names[i],
"%s%s%s", vidcap_params_get_driver(tmp),
strlen(vidcap_params_get_fmt(tmp)) > 0 ? ":" : "",
vidcap_params_get_fmt(tmp));
}

s->params = params;
Expand Down Expand Up @@ -261,7 +263,7 @@ vidcap_switcher_grab(void *state, struct audio_frame **audio)
if (s->excl_init) {
vidcap_done(s->devices[s->selected_device]);
s->devices[s->selected_device] = NULL;
int ret = initialize_video_capture(NULL,
int ret = initialize_video_capture(&s->mod,
vidcap_params_get_nth((struct vidcap_params *) s->params, new_selected_device + 1),
&s->devices[new_selected_device]);
assert(ret == 0);
Expand Down

0 comments on commit a2d3eb8

Please sign in to comment.