[vlc-devel] [PATCH] fix h264 encoding in windows

Christophe Mutricy xtophe at chewa.net
Wed Jan 28 00:59:06 CET 2009


> I'm not really sure if the configure part is where it should be.
> --- a/configure.ac
> @@ -1197,6 +1197,7 @@ elif test "${SYS}" != "mingwce"; then
>      VLC_ADD_PLUGIN([msn])
>      VLC_ADD_LIBS([dmo],[-lole32 -luuid])
>      VLC_ADD_PLUGIN([globalhotkeys])
> +    VLC_ADD_CFLAGS([x264],[-DPTW32_STATIC_LIB])

Bad things will happen if libx264 wasn't build with pthread in it.
At least from the Makefile in //extras/contrib/src it seems a
possibility.

So I would move that to the x264 section and detect if libx264 was
static linked with pthread and set the flag as appropriate ( or error
out if it doesn'nt make sense to use x264 without pthread)

I would do something like
AC_CHECK_LIB(pthread_win32_process_attach_np, x264, 
	VLC_ADD_CFLAGS([x264],[-DPTW32_STATIC_LIB]))

> diff --git a/extras/contrib/src/Patches/pthreads-detach.patch b/extras/contrib/src/Patches/pthreads-detach.patch
> new file mode 100644
That would be good to send it upstream and try to have it merged



> --- a/modules/codec/x264.c
>  #ifdef PTW32_STATIC_LIB
> +#include <sched.h>
>  #include <pthread.h>
(Slightly pedantic)
I can't see where we use stuff out of sched.h in x264.c. So it's likely to be
missing from pthread.h. Dunno if we already patches on libpthred_w32 but
it would be better there.



-- 
Xtophe



More information about the vlc-devel mailing list