Skip to content

fix camera listing#344

Open
poulpeit wants to merge 1 commit intoToufool:mainfrom
poulpeit:_fix_linux_cameras
Open

fix camera listing#344
poulpeit wants to merge 1 commit intoToufool:mainfrom
poulpeit:_fix_linux_cameras

Conversation

@poulpeit
Copy link

This PR has been made in order to fix an issue on capture device listing in the settings menu on linux.

Video devices are listed in /sys/class/video4linux with "video<ID>".
When adding or removing a new webcam, a new folder video<ID> is created or deleted, but there is some edge cases where ID are not contiguous (example: plug two devices and remove the first one).

As the code is currently a range(0, <number of folder>), in these edge cases, capture devices are not properly detected.

To fix this, I changed get_input_devices to properly list every folders.
As a side effect, I had to set enumerate into get_input_devices instead of get_all_video_capture_devices

Please note that, as I don't have any Windows available, tests were made only on Linux, but these changes should not break Autosplit on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant