mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-26 04:59:30 +08:00
win32: fix compilation on MinGW
The commit74df1d8e05(andf752212c62) replaced the configure endian check with byte order macros defined by standard headers. It turns out that MinGW-w64 actually doesn't define these macros in the sys/types.h system header. (I assumed it does, because a quick test seemed to work. But that was because gcc -W -Wall doesn't warn against undefined macros. You need -Wundef for that.) MinGW-w64 has a sys/params.h header defining these macros, but sys/types.h doesn't include it, so it's useless without special casing the mplayer code. Add a hack top configure instead. Define the macros directly, and assume MinGW-w64 only works on little endian machines. The other changes are basically random typos and superficial oversights.
This commit is contained in:
@@ -1018,6 +1018,10 @@ if mingw32 ; then
|
||||
_getch=getch2-win.c
|
||||
need_shmem=no
|
||||
extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
|
||||
# Hack for missing BYTE_ORDER declarations in <sys/types.h>.
|
||||
# (For some reason, they are in <sys/param.h>, but we don't bother switching
|
||||
# the includes based on whether we're compiling for MinGW.)
|
||||
extra_cflags="$extra_cflags -DBYTE_ORDER=1234 -DLITTLE_ENDIAN=1234 -DBIG_ENDIAN=4321"
|
||||
fi
|
||||
|
||||
TMPC="$mplayer_tmpdir/tmp.c"
|
||||
|
||||
+1
-1
@@ -1987,7 +1987,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
|
||||
if (!priv->d3d_device)
|
||||
return;
|
||||
|
||||
if (vo_osd_has_changed()) {
|
||||
if (vo_osd_has_changed(osd)) {
|
||||
struct draw_osd_closure ctx = { priv };
|
||||
|
||||
/* clear the OSD */
|
||||
|
||||
@@ -4163,7 +4163,7 @@ static void osdep_preinit(int *p_argc, char ***p_argv)
|
||||
GetCpuCaps(&gCpuCaps);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
mp_get_converted_argv(&argc, &argv);
|
||||
mp_get_converted_argv(p_argc, p_argv);
|
||||
#endif
|
||||
|
||||
#ifdef PTW32_STATIC_LIB
|
||||
|
||||
+9
-9
@@ -165,6 +165,15 @@ typedef struct {
|
||||
void** arStreamCaps; ///< VIDEO_STREAM_CONFIG_CAPS or AUDIO_STREAM_CONFIG_CAPS
|
||||
} chain_t;
|
||||
|
||||
typedef struct tt_stream_props_s{
|
||||
int sampling_rate;
|
||||
int samples_per_line;
|
||||
int offset;
|
||||
int count[2]; ///< number of lines in first and second fields
|
||||
int interlaced; ///< vbi data are interlaced
|
||||
int bufsize; ///< required buffer size
|
||||
} tt_stream_props;
|
||||
|
||||
typedef struct priv {
|
||||
int dev_index; ///< capture device index in device list (defaul: 0, first available device)
|
||||
int adev_index; ///< audio capture device index in device list (default: -1, not used)
|
||||
@@ -200,15 +209,6 @@ typedef struct priv {
|
||||
tv_param_t* tv_param; ///< TV parameters
|
||||
} priv_t;
|
||||
|
||||
typedef struct tt_stream_props_s{
|
||||
int sampling_rate;
|
||||
int samples_per_line;
|
||||
int offset;
|
||||
int count[2]; ///< number of lines in first and second fields
|
||||
int interlaced; ///< vbi data are interlaced
|
||||
int bufsize; ///< required buffer size
|
||||
} tt_stream_props;
|
||||
|
||||
#include "tvi_def.h"
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user