Motion - Bug Report 2005x 03x 27x 112843

BUG: Motion 3.2.1 will not compile with --without-v4l

Reported by KennethLavrsen for Philip Marien

I've come across a problem, and I'm not sure it qualifies as a bug, patch or whatever... Here it goes: if I compile Motion without V4L I get the following

gcc -g -O2 -DWITHOUT_V4L -DHAVE_MEMMEM -DTYPE_32BIT="int"   -march=i686 -DHAVE_BSWAP -Wall -DVERSION=\"3.2.1\" -D_REENTRANT -Dsysconfdir=\"/usr/local/etc\"   -c -o video.o video.c
video.c: In function `vid_start':
video.c:696: error: `vid_mutex' undeclared (first use in this function)
video.c:696: error: (Each undeclared identifier is reported only once
video.c:696: error: for each function it appears in.)
make: *** [video.o] Error 1

Not knowing the first thing about C, I set off to find the problem - in video.c, you have a whole section ifnedf'fed out, but there seems to be too much. With the following change, Motion compiles correctly with the --without-v4l switch...

642c642
< #endif /*WITHOUT_V4L*/
---
>
652d651
< #ifndef WITHOUT_V4L

Hope I didn't break something else....

Philip Marien Hasselt, Belgium

Test case

./configure --without-v4l

make

Environment

Motion version: 3.1.2 snap9
ffmpeg version: N/A
Shared libraries: N/A
Server OS: N/A

-- KennethLavrsen - 27 Mar 2005

Follow up

Yes. Your fix works. I tested it. Welcome in the CREDITS file of 3.2.1 and 3.1.20 smile

Fix record

In video.c find this code

/*****************************************************************************
   Wrappers calling the actual capture routines
 *****************************************************************************/

/* big lock for vid_start */
pthread_mutex_t vid_mutex;

and replace it with this code

/*****************************************************************************
   Wrappers calling the actual capture routines
 *****************************************************************************/

#endif /*WITHOUT_V4L*/
/* big lock for vid_start */
pthread_mutex_t vid_mutex;
#ifndef WITHOUT_V4L
Topic revision: r3 - 27 May 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.