dev47apps / droidcam-linux-client

GNU/Linux/nix client for DroidCam
http://www.dev47apps.com
GNU General Public License v2.0
1.08k stars 174 forks source link

Fixed bug introduced with commit 5693b0e that prevented the app from running in FreeBSD #265

Closed LS-FCEFyN closed 11 months ago

LS-FCEFyN commented 11 months ago

I've modified lines 99 and 100 from decoder_v4l2.c, I surrounded them with an ifdef linux preprocessor directive.

From:

    vid_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    xioctl(droidcam_device_fd, VIDIOC_S_FMT, &vid_format);

To:

#ifdef __linux__
    vid_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    xioctl(droidcam_device_fd, VIDIOC_S_FMT, &vid_format);
#endif

due to the way webcamd is implemented the current code fails with EINVAL (errno 22), fixing that error results in EBUSY; the only solution found thus far is this one.

After testing the app for a while no other bugs where found.