[Ffmpeg-devel] x264, Windows and u_char in x264.c

Matthew Dippel johngalt
Wed Apr 13 00:01:47 CEST 2005


Hi,

	Preface: Me < C Novice. (and worse yet, running Windows [at
least as far as ffmpeg is concerned])
	Of course, problem: ffMpeg wouldn't compile in Windows with x264
enabled.  The issue appears to be that there are two references to a
type "u_char" in x264.c. (Compiler Error Output below)
	Googled that error and found a reference to a solution from
another project which resulted in me replacing the two occurrences of
u_char in x264.c with uint8_t.  I was able to successfully compile and
encode a test MPEG2 file to h264.

	I apologize for not just providing a patch, but I don't know how
to do it, and on top of it all, I don't know what the ramifications of
changing these types are as a whole.  My hope is that a *real* C
developer could determine if this is acceptable or not...if it is, I'll
provide a patch that does exactly this below (as soon as I figure out
how the hell to use diff and provide it in such a way that does cause
others to flood the mailing list with angry posts):
 
Line 48 and 50 respectively were:
48: encode_nals(u_char *buf, int size, x264_nal_t *nals, int nnal)
50:    u_char *p = buf;
Line 48 and 50 after edit:
48: encode_nals(uint8_t *buf, int size, x264_nal_t *nals, int nnal)
50:    uint8_t *p = buf;

Configure:
./configure --enable-x264 --enable-mingw32 --enable-memalign-hack
--enable-gpl

Version: pulled from CVS two hours ago.

Compiler Error Output (prior to my modification):
gcc -O3 -g -Wall -Wno-s gcc -O3 -g -Wall -Wno-switch -HAVE_AV_CONFIG_H
-I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE  -c -o
x264.o x264.c 
x264.c:48: error: syntax error before '*' token
x264.c: In function `encode_nals':
x264.c:50: error: `u_char' undeclared (first use in this function)
x264.c:50: error: (Each undeclared identifier is reported only once
x264.c:50: error: for each function it appears in.)
x264.c:50: error: `p' undeclared (first use in this function)
x264.c:50: error: `buf' undeclared (first use in this function)
x264.c:53: error: `nnal' undeclared (first use in this function)
x264.c:54: error: `size' undeclared (first use in this function)
x264.c:54: error: `nals' undeclared (first use in this function)
make[1]: *** [x264.o] Error 1
make[1]: Leaving directory `/q/ffmpegproject/ffmpeg/libavcodec'
make: *** [lib] Error 2

My apologies, I pasted this crap directly and I'm stuck using fscking
outlook, so I have no idea if it didn't autocorrect the snot out of the
above (having closed the window).

Cheers,
Matt





More information about the ffmpeg-devel mailing list