[FFmpeg-devel] [PATCH] Fix compilation of static libraries with pthreads in MingW32

Horacio Sanson hsanson
Mon Aug 31 12:32:18 CEST 2009


FFMpeg static libraries fail to compile with the --enable-pthreads
switch in a MingW32 environment. Before
I used this patch
"http://ffmpeg.arrozcru.org/wiki/images/d/dd/Ffmpeg_r15966_static_pthreads.diff"
but it no
longer applies to the latest SVN.

I am no expert making make files and need some help to improve this line:

-enabled libx264    && require  libx264 x264.h x264_encoder_open -lx264 -lm &&
+enabled libx264    && require2 libx264 "stdint.h x264.h"
x264_encoder_open -lx264 -lpthreadGC2 -lws2_32 -lm &&

I am pretty sure adding "-lpthreadGC2 -lws2_32" is not correct as
pthreads depends on the configure flags but I do not
know how the correct way to do this. Without these flags added after
-lx264 I get unresolved symbol errors.


Also I ran the regression tests and "asf" failed (see output below)
but I think this has nothing to do with this changes.

regards,
Horacio


FFmpeg version SVN-r19750, Copyright (c) 2000-2009 Fabrice Bellard, et al.
??configuration: --enable-gpl --enable-libx264
--enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libfaad
--enable-libtheora --e
nable-libvorbis --enable-encoder=g726 --enable-static --disable-shared
--enable-encoder=ljpeg --enable-encoder=mjpeg --enable-libmp3lame --p
refix=/mingw --target-os=mingw32 --enable-memalign-hack --enable-zlib
--enable-ffplay --enable-avisynth --enable-pthreads --enable-version3
??libavutil ? ? 50. 3. 0 / 50. 3. 0
??libavcodec ? ?52.34. 0 / 52.34. 0
??libavformat ? 52.38. 0 / 52.38. 0
??libavdevice ? 52. 2. 0 / 52. 2. 0
??libswscale ? ? 0. 7. 1 / ?0. 7. 1
??built on Aug 31 2009 18:50:54, gcc: 3.4.5 (mingw-vista special r3)
Input #0, image2, from './tests/vsynth1/%02d.pgm':
??Duration: 00:00:02.00, start: 0.000000, bitrate: N/A
?? ?Stream #0.0: Video: pgmyuv, yuv420p, 352x288, 25 tbr, 25 tbn, 25 tbc
[NULL @ 0x39b7c90]Unknown option 'sws_flags'
Output #0, image2, to '././tests/data/b-lavf%02d.pcx':
?? ?Stream #0.0: Video: pcx, rgb24, 352x288, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
??Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= ? 13 fps= ?0 q=10.0 Lsize= ? ? ?-0kB time=0.52 bitrate= ?-0.3kbits/s
video:4626kB audio:0kB global headers:0kB muxing overhead -100.000464%
./ffmpeg_g -y -flags +bitexact -dct fastint -idct simple -sws_flags
+accurate_rnd+bitexact -i ././tests/data/b-lavf%02d.pcx -f crc
././tests
/data/pcx.lavf.crc
FFmpeg version SVN-r19750, Copyright (c) 2000-2009 Fabrice Bellard, et al.
??libavutil ? ? 50. 3. 0 / 50. 3. 0
??libavcodec ? ?52.34. 0 / 52.34. 0
??libavformat ? 52.38. 0 / 52.38. 0
??libavdevice ? 52. 2. 0 / 52. 2. 0
??libswscale ? ? 0. 7. 1 / ?0. 7. 1
[NULL @ 0x21844c0]Unknown option 'sws_flags'
?? ?Stream #0.0: Video: pcx, rgb24, 352x288, 25 tbr, 25 tbn, 25 tbc
?? ?Stream #0.0: Video: rawvideo, rgb24, 352x288, q=2-31, 200 kb/s,
90k tbn, 25 tbc
cat tests/data/avi.lavf.regression tests/data/asf.lavf.regression
tests/data/rm.lavf.regression tests/data/mpg.lavf.regression
tests/data/mx
f.lavf.regression tests/data/ts.lavf.regression
tests/data/swf.lavf.regression tests/data/ffm.lavf.regression
tests/data/flv_fmt.lavf.regres
sion tests/data/mov.lavf.regression tests/data/dv_fmt.lavf.regression
tests/data/gxf.lavf.regression tests/data/nut.lavf.regression tests/da
ta/mkv.lavf.regression tests/data/pbmpipe.lavf.regression
tests/data/pgmpipe.lavf.regression tests/data/ppmpipe.lavf.regression
tests/data/g
if.lavf.regression tests/data/yuv4mpeg.lavf.regression
tests/data/pgm.lavf.regression tests/data/ppm.lavf.regression
tests/data/bmp.lavf.reg
ression tests/data/tga.lavf.regression tests/data/tiff.lavf.regression
tests/data/sgi.lavf.regression tests/data/jpg.lavf.regression tests/d
ata/wav.lavf.regression tests/data/alaw.lavf.regression
tests/data/mulaw.lavf.regression tests/data/au.lavf.regression
tests/data/mmf.lavf.r
egression tests/data/aiff.lavf.regression
tests/data/voc.lavf.regression tests/data/ogg.lavf.regression
tests/data/pixfmt.lavf.regression te
sts/data/pcx.lavf.regression > tests/data/lavf.regression
diff -u -w "/home/skillup/Apps/ffmpeg-svn"/tests/lavf.regression.ref
tests/data/lavf.regression
gcc -DHAVE_AV_CONFIG_H -I. -I"/home/skillup/Apps/ffmpeg-svn"
-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_S
OURCE -I/include -I/mingw/include -I/usr/include -msse3 -O2 -pipe
-std=c99 -fno-common -fomit-frame-pointer -DPTW32_STATIC_LIB -g
-Wdeclar
ation-after-statement -Wall -Wno-switch -Wdisabled-optimization
-Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wundef
-O3 -f
no-math-errno ? ? ? -MMD -MF tests/seek_test.d -MT tests/seek_test.o
-c -o tests/seek_test.o tests/seek_test.c
In file included from ./libavutil/common.h:30,
?? ? ? ? ? ? ? ? from tests/seek_test.c:26:
c:/mingw/include/errno.h:91: warning: redundant redeclaration of '_errno'
c:/mingw/include/stdlib.h:137: warning: previous declaration of
'_errno' was here
gcc -L"/home/skillup/Apps/ffmpeg-svn"/libavcodec
-L"/home/skillup/Apps/ffmpeg-svn"/libavdevice
-L"/home/skillup/Apps/ffmpeg-svn"/libavfilter
?-L"/home/skillup/Apps/ffmpeg-svn"/libavformat
-L"/home/skillup/Apps/ffmpeg-svn"/libavutil
-L"/home/skillup/Apps/ffmpeg-svn"/libpostproc -L"
/home/skillup/Apps/ffmpeg-svn"/libswscale -L/lib -L/usr/lib
-L/mingw/lib -Wl,--warn-common -Wl,--as-needed
-Wl,-rpath-link,"/home/skillup/Ap
ps/ffmpeg-svn"/libpostproc
-Wl,-rpath-link,"/home/skillup/Apps/ffmpeg-svn"/libswscale
-Wl,-rpath-link,"/home/skillup/Apps/ffmpeg-svn"/libavf
ilter -Wl,-rpath-link,"/home/skillup/Apps/ffmpeg-svn"/libavdevice
-Wl,-rpath-link,"/home/skillup/Apps/ffmpeg-svn"/libavformat
-Wl,-rpath-lin
k,"/home/skillup/Apps/ffmpeg-svn"/libavcodec
-Wl,-rpath-link,"/home/skillup/Apps/ffmpeg-svn"/libavutil
-Wl,-Bsymbolic -o tests/seek_test.exe
?tests/seek_test.o -lavdevice -lavformat -lavcodec -lavutil -lswscale
-lz -lpthreadGC2 -lws2_32 -lm -lvfw32 -lfaad -lmp3lame -lm -lopencore-
amrnb -lm -lopencore-amrwb -lm -ltheora -logg -lvorbisenc -lvorbis
-logg -lx264 -lpthreadGC2 -lws2_32 -lm -lws2_32 -lvfw32
"/home/skillup/Apps/ffmpeg-svn"/tests/seek-regression.sh
"/home/skillup/Apps/ffmpeg-svn"/tests/seek.regression.ref "" "."
[rm @ 0x211c180]read_timestamp() failed in the middle
[asf @ 0x23dc190]asf_read_pts failed
[asf @ 0x30bf70]asf_read_pts failed
[asf @ 0x20bbf60]asf_read_pts failed
?? ?Last message repeated 4 times
[asf @ 0x20bbf60]freeing incomplete packet size 9111, new 9333
[asf @ 0x20bbf60]asf_read_pts failed
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]freeing incomplete packet size 9653, new 28658
[asf @ 0x20bbf60]freeing incomplete packet size 28658, new 11551
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[asf @ 0x20bbf60]ignoring invalid packet_obj_size (25313 2720 9852 28487)
[asf @ 0x20bbf60]freeing incomplete packet size 28487, new 9852
[asf @ 0x20bbf60]freeing incomplete packet size 9852, new 10545
[gxf @ 0x239bf60]Could not find codec parameters (Data: 0x0000)
[nut @ 0x1abbf60]no index at the end
[nut @ 0x1abbf60]read_timestamp failed.
seek regression test: success
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread-static-mingw.patch
Type: application/octet-stream
Size: 2158 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090831/bd6d47a3/attachment.obj>



More information about the ffmpeg-devel mailing list