summaryrefslogtreecommitdiffstats
path: root/test/test.c
diff options
context:
space:
mode:
authorhandbrake <[email protected]>2007-01-03 01:11:09 +0000
committerhandbrake <[email protected]>2007-01-03 01:11:09 +0000
commit79de879241d42814c3db4f897ad6a632ebe42a7f (patch)
tree44ac1a61c3b493e5cc2f99322a4ade200a6c29e3 /test/test.c
parent4a04f3ecd4d15ad7a47bc797e991f412c426b05f (diff)
Changes to make HandBrake build on Windows using the Cygwin environment:
root configure file: I added this to the "case $SYSTEM in" switch statement: CYGWIN_NT*) DEFINES="$DEFINES SYS_CYGWIN USE_PTHREAD" LINKLIBS="$LINKLIBS -lpthread" ;; Also, for each existing OS type that is using -lpthread, I added USE_PTHREAD to their DEFINES. Then libhb/ports.c was changed to use pthread code based on the value of USE_PTHREAD, instead of checking each different OS value that used pthreading, so it's a bit easier to read and maintain. root Jamfile: Jam doesn't seem to understand CYGWIN, so $(OS) is defined as UNKNOWN. Check for this, and if this it true then set $(OS) to CYGWIN. Since CSS doesn't work (yet) on CYGWIN/Windows, I also changed Jamfile to not include libdvdcss.a in the library list for CYGWIN. contrib/Jamfile: For CYGWIN, don't build libdvdcss, and don't specify it's path for libdvdread. There are also a few changes to use new patchfiles for Cygwin for a few of the libraries. x264: Change configure script so that it doesn't include -mno-cygwin flags for CYGWIN platform. Created patchfile patch-x264-cygwin.patch for this, which is used by Jamfile. The -mno-cygwin flags cause the library not to link correctly with HBTest.exe. The -mno-cygwin flag is used to create an object file or library that doesn't depend on cygwin1.dll if you're using MinGW, but I'm not (yet). libxvidcore: Change configure script so that it doesn't include -mno-cygwin flags for CYGWIN platform. Change configure script so that it uses libxvidcore.a as the lib name instead of xvidcore.a for CYGWIN. Created patchfile patch-xvidcore-cygwin.patch that contains the 2 above changes and is used by Jamfile. Renamed patch-xvidcore.patch to patch-xvidcore-macosx.patch and updated Jamfile as appropriate -- an attempt to keep the patches being applied only when needed for a particular platform. ffmpeg: libavcodec/mpegaudiodec.c uses llrint(), which apparently isn't availble with Cygwin, so I changed the file to use lrint() which is available. llrint() returns a long long, lrint() returns a long. In the places where llrint() was being called, the return value of llrint() was being assigned to an element in an array of unsigned ints, so llrint() (long long) shouldn't be needed, and lrint() (long) should be fine. Created patchfile patch-ffmpeg-cygwin.patch that contains this change, and is used by Jamfile. libhb/ports.c: Commented out a number of things that were broken with the current SYS_CYGWIN code. The most notable change was to not use Windows threading for CYGWIN, and instead use pthreading. All the places where the OS type was being checked to determine whether or not to use pthreading were changed so that the USE_PTHREAD define is checked instead. There seems to be some problem with the Windows threading code in ports.c, because if I enable it then x264 encodes will either crash or lock-up HBTest.exe. Perhaps this is related to mixing threading models, since x264 is compiled with pthread support, and so maybe mixing pthread with Windows threading in the same process is a bad thing. test/test.c: Need to #include sys/time.h, time.h, unistd.h to compile. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@84 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test.c b/test/test.c
index 0f43a7f16..de499f4fd 100644
--- a/test/test.c
+++ b/test/test.c
@@ -6,6 +6,9 @@
#include <signal.h>
#include <getopt.h>
+#include <sys/time.h>
+#include <time.h>
+#include <unistd.h>
#include "hb.h"