diff --git a/DOCS/man/cs/mplayer.1 b/DOCS/man/cs/mplayer.1 index 174e4f063d..e043066b58 100644 --- a/DOCS/man/cs/mplayer.1 +++ b/DOCS/man/cs/mplayer.1 @@ -10306,12 +10306,6 @@ DODĚLAT: Zdokumentovat. .B USERPROFILE DODĚLAT: Zdokumentovat. . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -DODĚLAT: Zdokumentovat. -. .SS GUI: . .TP diff --git a/DOCS/man/de/mplayer.1 b/DOCS/man/de/mplayer.1 index 12a545157c..635fcdb959 100644 --- a/DOCS/man/de/mplayer.1 +++ b/DOCS/man/de/mplayer.1 @@ -11383,12 +11383,6 @@ FIXME: Muss noch dokumentiert werden. .B USERPROFILE FIXME: Muss noch dokumentiert werden. . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: Muss noch dokumentiert werden. -. .SS GUI: . .TP diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 46486245ec..5b102868d7 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3473,8 +3473,7 @@ Select the driver to use as source to overlay on top of X11. .PD 1 . .TP -.B vdpau (with \-vc ffmpeg12vdpau, ffwmv3vdpau, ffvc1vdpau, ffh264vdpau -or ffodivxvdpau) +.B vdpau (with \-vc ffmpeg12vdpau, ffwmv3vdpau, ffvc1vdpau, ffh264vdpau or ffodivxvdpau) Video output that uses VDPAU to decode video via hardware. Also supports displaying of software-decoded video. .PD 0 @@ -11302,12 +11301,6 @@ FIXME: Document this. .B USERPROFILE FIXME: Document this. . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: Document this. -. .SS GUI: . .TP diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 6209931071..cf33b922c8 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -11695,12 +11695,6 @@ FIXME: Documente ceci. .B USERPROFILE FIXME: Documente ceci. . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: Documente ceci. -. .SS GUI: . .TP diff --git a/DOCS/man/hu/mplayer.1 b/DOCS/man/hu/mplayer.1 index e81f276a82..ce0edb7e43 100644 --- a/DOCS/man/hu/mplayer.1 +++ b/DOCS/man/hu/mplayer.1 @@ -11168,12 +11168,6 @@ FIXME: Ezt m .B USERPROFILE FIXME: Ezt mg dokumentlni kell. . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: Ezt mg dokumentlni kell. -. .SS GUI: . .TP diff --git a/DOCS/man/it/mplayer.1 b/DOCS/man/it/mplayer.1 index 391ad7571f..26d6bd3220 100644 --- a/DOCS/man/it/mplayer.1 +++ b/DOCS/man/it/mplayer.1 @@ -11631,12 +11631,6 @@ FIXME: Da documentare. .B USERPROFILE FIXME: Da documentare. . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: Da documentare. -. .SS GUI: . .TP diff --git a/DOCS/man/ru/mplayer.1 b/DOCS/man/ru/mplayer.1 index 5a958c27d4..fdfd02db68 100644 --- a/DOCS/man/ru/mplayer.1 +++ b/DOCS/man/ru/mplayer.1 @@ -11271,12 +11271,6 @@ FIXME: .B USERPROFILE FIXME: . . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: . -. .SS GUI: . .TP diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1 index fdc0d0f7ae..cd25a33084 100644 --- a/DOCS/man/zh_CN/mplayer.1 +++ b/DOCS/man/zh_CN/mplayer.1 @@ -1,4 +1,4 @@ -.\" sync with en/mplayer.1 rev. 30868 +.\" sync with en/mplayer.1 rev. 30936 .\" Encoding: UTF-8 .\" Reminder of hard terms which need better/final solution later: .\" /capture; playtree in parent list; colorkey; retrace; desync; downmix; @@ -625,6 +625,11 @@ lavcopts=mbd=2:trell=yes:v4mv=yes .SH "通用选项" . .TP +.B \-codecpath +指定已编译编解码器的存放目录。 +Specify a directory for binary codecs. +. +.TP .B \-codecs\-file <文件名>(也请参见 \-afm,\-ac,\-vfm,\-vc) 重载标准的搜索路径并使用指定的文件代替内置的 codecs.conf。 . @@ -3271,7 +3276,7 @@ ggi 和 gl2 的都支持此功能。 .PD 1 . .TP -.B vdpau(与 \-vc ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau 或 +.B vdpau(与 \-vc ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau 或 ffodivxvdpau 一同使用) 使用 VDPAU 硬件解码视频的视频输出方式。 同时支持显示软件解码的视频。 @@ -10560,12 +10565,6 @@ FIXME: 待解释。 .B USERPROFILE FIXME: 待解释。 . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: 待解释。 -. .SS GUI: . .TP diff --git a/Makefile b/Makefile index 6bcb759764..c1d8b7f2c3 100644 --- a/Makefile +++ b/Makefile @@ -337,13 +337,13 @@ SRCS_COMMON = asxparser.c \ edl.c \ find_sub.c \ fmt-conversion.c \ - get_path.c \ m_config.c \ m_option.c \ m_struct.c \ mp_msg.c \ mpcommon.c \ parser-cfg.c \ + path.c \ playtree.c \ playtreeparser.c \ spudec.c \ @@ -549,7 +549,8 @@ SRCS_MPLAYER-$(ESD) += libao2/ao_esd.c SRCS_MPLAYER-$(FBDEV) += libvo/vo_fbdev.c libvo/vo_fbdev2.c SRCS_MPLAYER-$(GGI) += libvo/vo_ggi.c SRCS_MPLAYER-$(GIF) += libvo/vo_gif89a.c -SRCS_MPLAYER-$(GL) += libvo/gl_common.c libvo/vo_gl.c libvo/vo_gl2.c libvo/csputils.c +SRCS_MPLAYER-$(GL) += libvo/gl_common.c libvo/vo_gl.c \ + libvo/vo_gl2.c libvo/csputils.c SRCS_MPLAYER-$(GL_WIN32) += libvo/w32_common.c SRCS_MPLAYER-$(GL_X11) += libvo/x11_common.c SRCS_MPLAYER-$(MATRIXVIEW) += libvo/vo_matrixview.c libvo/matrixview.c @@ -621,7 +622,8 @@ SRCS_MPLAYER-$(VIDIX_UNICHROME) += vidix/unichrome_vid.c SRCS_MPLAYER-$(WII) += libvo/vo_wii.c SRCS_MPLAYER-$(WIN32WAVEOUT) += libao2/ao_win32.c SRCS_MPLAYER-$(WINVIDIX) += libvo/vo_winvidix.c -SRCS_MPLAYER-$(X11) += libvo/vo_x11.c libvo/vo_xover.c libvo/x11_common.c +SRCS_MPLAYER-$(X11) += libvo/vo_x11.c libvo/vo_xover.c \ + libvo/x11_common.c SRCS_MPLAYER-$(XMGA) += libvo/vo_xmga.c SRCS_MPLAYER-$(XV) += libvo/vo_xv.c SRCS_MPLAYER-$(XVIDIX) += libvo/vo_xvidix.c @@ -655,7 +657,8 @@ SRCS_MENCODER-$(FAAC) += libmpcodecs/ae_faac.c SRCS_MENCODER-$(LIBAVCODEC) += libmpcodecs/ae_lavc.c libmpcodecs/ve_lavc.c SRCS_MENCODER-$(LIBAVFORMAT) += libmpdemux/muxer_lavf.c SRCS_MENCODER-$(LIBDV) += libmpcodecs/ve_libdv.c -SRCS_MENCODER-$(LIBLZO) += libmpcodecs/ve_nuv.c libmpcodecs/native/rtjpegn.c +SRCS_MENCODER-$(LIBLZO) += libmpcodecs/ve_nuv.c \ + libmpcodecs/native/rtjpegn.c SRCS_MENCODER-$(MP3LAME) += libmpcodecs/ae_lame.c SRCS_MENCODER-$(QTX_CODECS_WIN32) += libmpcodecs/ve_qtvideo.c SRCS_MENCODER-$(TOOLAME) += libmpcodecs/ae_toolame.c diff --git a/ass_mp.c b/ass_mp.c index 9e62e16a3e..4161397c95 100644 --- a/ass_mp.c +++ b/ass_mp.c @@ -29,7 +29,7 @@ #include #include "mp_msg.h" -#include "get_path.h" +#include "path.h" #include "ass_mp.h" #include "subreader.h" #include "stream/stream.h" diff --git a/cfg-common-opts.h b/cfg-common-opts.h index f8ba7b446f..32395ad1c2 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -32,9 +32,7 @@ #ifdef CONFIG_PRIORITY {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif -#ifdef CONFIG_WIN32DLL {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#endif {"noconfig", (void *) noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL}, // ------------------------- stream options -------------------- diff --git a/command.c b/command.c index 9084ff37df..aaf5ec4f95 100644 --- a/command.c +++ b/command.c @@ -49,7 +49,7 @@ #include "libmpcodecs/dec_teletext.h" #include "vobsub.h" #include "spudec.h" -#include "get_path.h" +#include "path.h" #include "ass_mp.h" #include "stream/tv.h" #include "stream/stream_radio.h" diff --git a/configure b/configure index 0d150d1581..b61a212c7e 100755 --- a/configure +++ b/configure @@ -1670,13 +1670,12 @@ fi def_fast_64bit='#define HAVE_FAST_64BIT 0' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0' -arch_all='X86 X86_32 X86_64 IA64 SPARC ARM AVR32 SH4 PPC PPC64 ALPHA MIPS SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC' +arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC' +subarch_all='X86_32 X86_64 PPC64' case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) - arch='X86 X86_32' - libavcodec_arch="x86" - target_arch="ARCH_X86 = yes" - target_subarch="ARCH_X86_32 = yes" + arch='x86' + subarch='x86_32' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc=486 proc=i486 @@ -1913,17 +1912,14 @@ EOF ;; ia64) - arch='IA64' - target_arch='ARCH_IA64 = yes' + arch='ia64' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='ia64' ;; x86_64|amd64) - arch='X86 X86_64' - libavcodec_arch="x86" - target_subarch='ARCH_X86_64 = yes' - target_arch="ARCH_X86 = yes" + arch='x86' + subarch='x86_64' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='x86_64' @@ -2016,9 +2012,7 @@ EOF ;; sparc|sparc64) - arch='SPARC' - libavcodec_arch="sparc" - target_arch='ARCH_SPARC = yes' + arch='sparc' iproc='sparc' if test "$host_arch" = "sparc64" ; then _vis='yes' @@ -2045,39 +2039,30 @@ EOF ;; arm*) - arch='ARM' - libavcodec_arch="arm" - target_arch='ARCH_ARM = yes' + arch='arm' iproc='arm' ;; avr32) - arch='AVR32' - libavcodec_arch="avr32" - target_arch='ARCH_AVR32 = yes' + arch='avr32' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='avr32' test $_fast_clz = "auto" && _fast_clz=yes ;; sh|sh4) - arch='SH4' - libavcodec_arch="sh4" - target_arch='ARCH_SH4 = yes' + arch='sh4' iproc='sh4' ;; ppc|ppc64|powerpc|powerpc64) - arch='PPC' + arch='ppc' def_dcbzl='#define HAVE_DCBZL 0' - libavcodec_arch="ppc" - target_arch='ARCH_PPC = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='ppc' if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then - arch='PPC PPC64' - target_subarch='ARCH_PPC64 = yes' + subarch='ppc64' def_fast_64bit='#define HAVE_FAST_64BIT 1' fi echocheck "CPU type" @@ -2185,9 +2170,7 @@ EOF ;; alpha*) - arch='ALPHA' - libavcodec_arch="alpha" - target_arch='ARCH_ALPHA = yes' + arch='alpha' iproc='alpha' def_fast_64bit='#define HAVE_FAST_64BIT 1' @@ -2230,10 +2213,8 @@ EOF ;; mips) - arch='SGI_MIPS' - libavcodec_arch="mips" - target_arch='ARCH_SGI_MIPS = yes' - iproc='sgi-mips' + arch='mips' + iproc='mips' if irix ; then echocheck "CPU type" @@ -2258,38 +2239,32 @@ EOF ;; hppa) - arch='PA_RISC' - target_arch='ARCH_PA_RISC = yes' + arch='pa_risc' iproc='PA-RISC' ;; s390) - arch='S390' - target_arch='ARCH_S390 = yes' + arch='s390' iproc='390' ;; s390x) - arch='S390X' - target_arch='ARCH_S390X = yes' + arch='s390x' iproc='390x' ;; vax) - arch='VAX' - target_arch='ARCH_VAX = yes' + arch='vax' iproc='vax' ;; xtensa) - arch='XTENSA' - target_arch='ARCH_XTENSA = yes' + arch='xtensa' iproc='xtensa' ;; generic) - arch='GENERIC' - target_arch='ARCH_GENERIC = yes' + arch='generic' ;; *) @@ -2741,27 +2716,27 @@ EOF echores "$_iwmmxt" fi -_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' -test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts" -test "$_mmx" = yes && _cpuexts="MMX $_cpuexts" -test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts" -test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts" -test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts" -test "$_sse" = yes && _cpuexts="SSE $_cpuexts" -test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts" -test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts" -test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts" -test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts" -test "$_fast_clz" = yes && _cpuexts="FAST_CLZ $_cpuexts" -test "$pld" = yes && _cpuexts="PLD $_cpuexts" -test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts" -test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts" -test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts" -test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts" -test "$neon" = yes && _cpuexts="NEON $_cpuexts" -test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts" -test "$_vis" = yes && _cpuexts="VIS $_cpuexts" -test "$_mvi" = yes && _cpuexts="MVI $_cpuexts" +cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' +test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts" +test "$_mmx" = yes && cpuexts="MMX $cpuexts" +test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts" +test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts" +test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts" +test "$_sse" = yes && cpuexts="SSE $cpuexts" +test "$_sse2" = yes && cpuexts="SSE2 $cpuexts" +test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts" +test "$_cmov" = yes && cpuexts="CMOV $cpuexts" +test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts" +test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts" +test "$pld" = yes && cpuexts="PLD $cpuexts" +test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts" +test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts" +test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts" +test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts" +test "$neon" = yes && cpuexts="NEON $cpuexts" +test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts" +test "$_vis" = yes && cpuexts="VIS $cpuexts" +test "$_mvi" = yes && cpuexts="MVI $cpuexts" # Checking kernel version... if x86_32 && linux ; then @@ -7810,6 +7785,17 @@ echores "$_dvdnav" # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check). # Read dvdnav comment above. +mak_enable () { +list=$(echo $1 | tr '[a-z]' '[A-Z]') +item=$(echo $2 | tr '[a-z]' '[A-Z]') +nprefix=$3; +for part in $list; do + if $(echo $item | grep -q -E "(^| )$part($| )"); then + echo "${nprefix}_$part = yes" + fi +done +} + ############################################################################# echo "Creating config.mak" cat > config.mak << EOF @@ -7841,10 +7827,8 @@ AS = $_cc CC = $_cc CXX = $_cc HOST_CC = $_host_cc -YASM = $_yasm INSTALL = $_install INSTALLSTRIP = $_install_strip -RANLIB = $_ranlib WINDRES = $_windres CFLAGS = $CFLAGS $extra_cflags @@ -7858,7 +7842,6 @@ CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer CFLAGS_STACKREALIGN = $cflags_stackrealign CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper CFLAGS_TREMOR_LOW = $cflags_tremor_low -YASMFLAGS = $YASMFLAGS EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs EXTRALIBS_MPLAYER = $libs_mplayer @@ -7873,10 +7856,10 @@ TIMER = $_timer EXESUF = $_exesuf EXESUFS_ALL = .exe -$target_arch -ARCH = $libavcodec_arch -$target_subarch -$(echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/') +ARCH = $arch +$(mak_enable "$arch_all" "$arch" ARCH) +$(mak_enable "$subarch_all" "$subarch" ARCH) +$(mak_enable "$cpuexts_all" "$cpuexts" HAVE) MENCODER = $_mencoder MPLAYER = $_mplayer @@ -7961,7 +7944,6 @@ LIBSMBCLIENT = $_smb LIBTHEORA = $_theora LIRC = $_lirc LIVE555 = $_live -MACOSX_BUNDLE = $_macosx_bundle MACOSX_FINDER = $_macosx_finder MD5SUM = $_md5sum MGA = $_mga @@ -8057,6 +8039,10 @@ LIBAVCODEC_INTERNALS = $_libavcodec_internals LIBSWSCALE_INTERNALS = $_libswscale_internals FFMPEG_SOURCE_PATH = $_ffmpeg_source +RANLIB = $_ranlib +YASM = $_yasm +YASMFLAGS = $YASMFLAGS + # Some FFmpeg codecs depend on these. Enable them unconditionally for now. CONFIG_AANDCT=yes CONFIG_FFT=yes @@ -8085,10 +8071,12 @@ EOF ############################################################################# ff_config_enable () { +list=$(echo $1 | tr '[a-z]' '[A-Z]') +item=$(echo $2 | tr '[a-z]' '[A-Z]') _nprefix=$3; test -z "$_nprefix" && _nprefix='CONFIG' -for part in $1; do - if $(echo $2 | grep -q -E "(^| )$part($| )"); then +for part in $list; do + if $(echo $item | grep -q -E "(^| )$part($| )"); then echo "#define ${_nprefix}_$part 1" else echo "#define ${_nprefix}_$part 0" @@ -8240,7 +8228,8 @@ $def_pthread_cache $def_words_endian $def_bigendian $(ff_config_enable "$arch_all" "$arch" "ARCH") -$(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE") +$(ff_config_enable "$subarch_all" "$subarch" "ARCH") +$(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE") /* DVD/VCD/CD */ diff --git a/cpudetect.c b/cpudetect.c index efaa88de37..c95aceea6c 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -535,8 +535,8 @@ if (ARCH_PPC) if (ARCH_ALPHA) mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Digital Alpha\n"); -if (ARCH_SGI_MIPS) - mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: SGI MIPS\n"); +if (ARCH_MIPS) + mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: MIPS\n"); if (ARCH_PA_RISC) mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Hewlett-Packard PA-RISC\n"); diff --git a/etc/codecs.conf b/etc/codecs.conf index 0d5fdba29d..808f1e3335 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -3245,20 +3245,20 @@ videocodec rawyv12 videocodec rawnv21 info "RAW NV21" status working - driver hmblck + driver raw format 0x0 0x3132564E format 0x20776172 0x3132564E fourcc nv21,NV21 - out YV12 + out NV21 videocodec rawnv12 info "RAW NV12" status working - driver hmblck + driver raw format 0x0 0x3231564E format 0x20776172 0x3231564E fourcc nv12,NV12 - out YV12 + out NV12 videocodec rawhm12 info "RAW HM12" diff --git a/input/input.c b/input/input.c index 0c50bdff08..1fdb0972e3 100644 --- a/input/input.c +++ b/input/input.c @@ -42,7 +42,7 @@ #include "mp_msg.h" #include "m_config.h" #include "m_option.h" -#include "get_path.h" +#include "path.h" #include "talloc.h" #include "options.h" diff --git a/libaf/af_export.c b/libaf/af_export.c index 949f3f18ca..e3eb917fc7 100644 --- a/libaf/af_export.c +++ b/libaf/af_export.c @@ -38,7 +38,7 @@ #include #include "af.h" -#include "get_path.h" +#include "path.h" #define DEF_SZ 512 // default buffer size (in samples) #define SHARED_FILE "mplayer-af_export" /* default file name diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c index dd8b2947ec..0b7fb219f7 100644 --- a/libmpcodecs/ad_realaud.c +++ b/libmpcodecs/ad_realaud.c @@ -26,6 +26,7 @@ #ifdef HAVE_LIBDL #include #endif +#include "path.h" #include "ad_internal.h" #include "loader/wine/windef.h" @@ -220,9 +221,9 @@ static int preinit(sh_audio_t *sh){ unsigned int result; char *path; - path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2); + path = malloc(strlen(codec_path) + strlen(sh->codec->dll) + 2); if (!path) return 0; - sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll); + sprintf(path, "%s/%s", codec_path, sh->codec->dll); /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ @@ -246,8 +247,8 @@ static int preinit(sh_audio_t *sh){ if(raSetDLLAccessPath){ #endif // used by 'SIPR' - path = realloc(path, strlen(BINARY_CODECS_PATH) + 13); - sprintf(path, "DT_Codecs=" BINARY_CODECS_PATH); + path = realloc(path, strlen(codec_path) + 13); + sprintf(path, "DT_Codecs=%s", codec_path); if(path[strlen(path)-1]!='/'){ path[strlen(path)+1]=0; path[strlen(path)]='/'; @@ -268,15 +269,17 @@ static int preinit(sh_audio_t *sh){ #ifdef CONFIG_WIN32DLL if (dll_type == 1){ - if(wraOpenCodec2) - result = wraOpenCodec2(&sh->context, BINARY_CODECS_PATH "\\"); - else + if (wraOpenCodec2) { + sprintf(path, "%s\\", codec_path); + result = wraOpenCodec2(&sh->context, path); + } else result=wraOpenCodec(&sh->context); } else #endif - if(raOpenCodec2) - result = raOpenCodec2(&sh->context, BINARY_CODECS_PATH "/"); - else + if (raOpenCodec2) { + sprintf(path, "%s/", codec_path); + result = raOpenCodec2(&sh->context, path); + } else result=raOpenCodec(&sh->context); if(result){ mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result); diff --git a/libmpcodecs/vd_hmblck.c b/libmpcodecs/vd_hmblck.c index 81b1c4373b..a9a871cae2 100644 --- a/libmpcodecs/vd_hmblck.c +++ b/libmpcodecs/vd_hmblck.c @@ -24,8 +24,6 @@ #include "vd_internal.h" -#define TEMP_BUF_SIZE (720*576) - static const vd_info_t info = { "Hauppauge Macroblock/NV12/NV21 Decoder", "hmblck", @@ -92,11 +90,6 @@ static int nv12_to_yv12(unsigned char *data, int len, mp_image_t* mpi, int swapp "hmblck: Image size inconsistent with data size.\n"); return 0; } - if ( (mpi->width > 720) || (mpi->height > 576) ) { - mp_msg(MSGT_DECVIDEO,MSGL_ERR, - "hmblck: Image size is too big.\n"); - return 0; - } if (mpi->num_planes != 3) { mp_msg(MSGT_DECVIDEO,MSGL_ERR, "hmblck: Incorrect number of image planes.\n"); diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c index be67210f88..5f4d7cb8a8 100644 --- a/libmpcodecs/vd_realvid.c +++ b/libmpcodecs/vd_realvid.c @@ -27,6 +27,7 @@ #include "mp_msg.h" #include "mpbswap.h" +#include "path.h" #include "vd_internal.h" #include "loader/wine/windef.h" @@ -292,9 +293,9 @@ static int init(sh_video_t *sh){ mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",be2me_32(((unsigned int*)extrahdr)[1]),be2me_32(((unsigned int*)extrahdr)[0])); - path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2); + path = malloc(strlen(codec_path) + strlen(sh->codec->dll) + 2); if (!path) return 0; - sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll); + sprintf(path, "%s/%s", codec_path, sh->codec->dll); /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ diff --git a/libmpcodecs/vd_theora.c b/libmpcodecs/vd_theora.c index 1c69de6df8..ddf81fa5c7 100644 --- a/libmpcodecs/vd_theora.c +++ b/libmpcodecs/vd_theora.c @@ -26,6 +26,8 @@ #include "vd_internal.h" +#include "ffmpeg_files/intreadwrite.h" + static const vd_info_t info = { "Theora/VP3", "theora", @@ -74,6 +76,8 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ */ static int init(sh_video_t *sh){ theora_struct_t *context = NULL; + uint8_t *extradata = (uint8_t *)(sh->bih + 1); + int extradata_size = sh->bih->biSize - sizeof(*sh->bih); int errorCode = 0; ogg_packet op; int i; @@ -89,8 +93,21 @@ static int init(sh_video_t *sh){ /* Read all header packets, pass them to theora_decode_header. */ for (i = 0; i < THEORA_NUM_HEADER_PACKETS; i++) { - op.bytes = ds_get_packet (sh->ds, &op.packet); - op.b_o_s = 1; + if (extradata_size > 2) { + op.bytes = AV_RB16(extradata); + op.packet = extradata + 2; + op.b_o_s = 1; + if (extradata_size < op.bytes + 2) { + mp_msg(MSGT_DECAUDIO, MSGL_ERR, "Theora header too small\n"); + goto err_out; + } + extradata += op.bytes + 2; + extradata_size -= op.bytes + 2; + } else { + op.bytes = ds_get_packet (sh->ds, &op.packet); + op.b_o_s = 1; + } + if ( (errorCode = theora_decode_header (&context->inf, &context->cc, &op)) ) { mp_msg(MSGT_DECAUDIO, MSGL_ERR, "Broken Theora header; errorCode=%i!\n", errorCode); diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index c756c8b8b7..da61f73245 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -29,7 +29,7 @@ #include /* strerror */ #include "config.h" - +#include "path.h" #include "mp_msg.h" #include "vd_internal.h" @@ -649,7 +649,6 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ static int init(sh_video_t *sh) { vd_xanim_ctx *priv; - char *def_path = BINARY_CODECS_PATH; char dll[1024]; XA_CODEC_HDR codec_hdr; int i; @@ -668,10 +667,7 @@ static int init(sh_video_t *sh) for (i=0; i < XA_CLOSE_FUNCS; i++) xa_close_func[i] = NULL; - if (getenv("XANIM_MOD_DIR")) - def_path = getenv("XANIM_MOD_DIR"); - - snprintf(dll, 1024, "%s/%s", def_path, sh->codec->dll); + snprintf(dll, 1024, "%s/%s", codec_path, sh->codec->dll); if (xacodec_load(sh, dll) == 0) return 0; diff --git a/libmpcodecs/vf_gradfun.c b/libmpcodecs/vf_gradfun.c index 66d921a4c1..f7495948e5 100644 --- a/libmpcodecs/vf_gradfun.c +++ b/libmpcodecs/vf_gradfun.c @@ -102,7 +102,7 @@ static void filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, width = x; } x = -width; - asm volatile( + __asm__ volatile( "movd %4, %%mm5 \n" "pxor %%mm7, %%mm7 \n" "pshufw $0, %%mm5, %%mm5 \n" @@ -150,7 +150,7 @@ static void filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, width = x; } x = -width; - asm volatile( + __asm__ volatile( "movd %4, %%xmm5 \n" "pxor %%xmm7, %%xmm7 \n" "pshuflw $0,%%xmm5, %%xmm5 \n" @@ -187,7 +187,7 @@ static void filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, #define BLURV(load)\ intptr_t x = -2*width;\ - asm volatile(\ + __asm__ volatile(\ "movdqa %6, %%xmm7 \n"\ "1: \n"\ load" (%4,%0), %%xmm0 \n"\ diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 70edf16efb..577c34caba 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -44,7 +44,8 @@ #include "mp_taglists.h" -#define INITIAL_PROBE_SIZE (32*1024) +#define INITIAL_PROBE_SIZE STREAM_BUFFER_SIZE +#define SMALL_MAX_PROBE_SIZE (32 * 1024) #define PROBE_BUF_SIZE (2*1024*1024) const m_option_t lavfdopts_conf[] = { @@ -171,20 +172,21 @@ static int lavf_check_file(demuxer_t *demuxer){ avpd.buf = av_mallocz(FFMAX(BIO_BUFFER_SIZE, PROBE_BUF_SIZE) + FF_INPUT_BUFFER_PADDING_SIZE); do { - read_size = stream_read(demuxer->stream, avpd.buf + probe_data_size, read_size); - if(read_size < 0) { - av_free(avpd.buf); - return 0; - } - probe_data_size += read_size; - avpd.filename= demuxer->stream->url; - if (!strncmp(avpd.filename, "ffmpeg://", 9)) - avpd.filename += 9; - avpd.buf_size= probe_data_size; + read_size = stream_read(demuxer->stream, avpd.buf + probe_data_size, read_size); + if(read_size < 0) { + av_free(avpd.buf); + return 0; + } + probe_data_size += read_size; + avpd.filename= demuxer->stream->url; + if (!strncmp(avpd.filename, "ffmpeg://", 9)) + avpd.filename += 9; + avpd.buf_size= probe_data_size; - priv->avif= av_probe_input_format(&avpd, probe_data_size > 0); - read_size = FFMIN(2*read_size, PROBE_BUF_SIZE - probe_data_size); - } while (demuxer->desc->type != DEMUXER_TYPE_LAVF_PREFERRED && + priv->avif= av_probe_input_format(&avpd, probe_data_size > 0); + read_size = FFMIN(2*read_size, PROBE_BUF_SIZE - probe_data_size); + } while ((demuxer->desc->type != DEMUXER_TYPE_LAVF_PREFERRED || + probe_data_size < SMALL_MAX_PROBE_SIZE) && !priv->avif && read_size > 0 && probe_data_size < PROBE_BUF_SIZE); av_free(avpd.buf); diff --git a/libmpdemux/video.c b/libmpdemux/video.c index cf0cc9f6a5..b8a26d61d2 100644 --- a/libmpdemux/video.c +++ b/libmpdemux/video.c @@ -323,7 +323,7 @@ mpeg_header_parser: if(!sh_video->fps){ sh_video->frametime=0; } else { - sh_video->frametime=1.0/picture.fps; + sh_video->frametime=1.0/sh_video->fps; } sh_video->disp_w=picture.display_picture_width; sh_video->disp_h=picture.display_picture_height; diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index cd809e2bcb..1cd6fb5733 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -47,7 +47,7 @@ #include "font_load.h" #include "mp_msg.h" #include "mplayer.h" -#include "get_path.h" +#include "path.h" #include "osd_font.h" #if (FREETYPE_MAJOR > 2) || (FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 1) diff --git a/libvo/osx_common.c b/libvo/osx_common.c index e82bc7aa6e..b3e39a62aa 100644 --- a/libvo/osx_common.c +++ b/libvo/osx_common.c @@ -19,6 +19,7 @@ // only to get keycode definitions from HIToolbox/Events.h #include +#include "config.h" #include "osx_common.h" #include "old_vo_defines.h" #include "video_out.h" @@ -141,3 +142,25 @@ void config_movie_aspect(float config_aspect) old_movie_aspect = config_aspect; our_aspect_change = 0; } + +/** This chunk of code is heavily based off SDL_macosx.m from SDL. + * The CPSEnableForegroundOperation that was here before is private + * and should not be used. + * Replaced by a call to the 10.3+ TransformProcessType. + */ +void osx_foreground_hack(void) +{ +#if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL) + ProcessSerialNumber myProc, frProc; + Boolean sameProc; + + if (GetFrontProcess(&frProc) == noErr && + GetCurrentProcess(&myProc) == noErr) { + if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc) { + TransformProcessType(&myProc, + kProcessTransformToForegroundApplication); + } + SetFrontProcess(&myProc); + } +#endif +} diff --git a/libvo/osx_common.h b/libvo/osx_common.h index d20698e411..21bb3d8548 100644 --- a/libvo/osx_common.h +++ b/libvo/osx_common.h @@ -22,5 +22,6 @@ int convert_key(unsigned key, unsigned charcode); void change_movie_aspect(float new_aspect); void config_movie_aspect(float config_aspect); +void osx_foreground_hack(void); #endif /* MPLAYER_OSX_COMMON_H */ diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index 9cd3447072..be45813f8c 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -386,23 +386,7 @@ static int preinit(const char *arg) NSApp = [NSApplication sharedApplication]; isLeopardOrLater = floor(NSAppKitVersionNumber) > 824; - #if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL) - //this chunk of code is heavily based off SDL_macosx.m from SDL - ProcessSerialNumber myProc, frProc; - Boolean sameProc; - - if (GetFrontProcess(&frProc) == noErr) - { - if (GetCurrentProcess(&myProc) == noErr) - { - if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc) - { - TransformProcessType(&myProc, kProcessTransformToForegroundApplication); - } - SetFrontProcess(&myProc); - } - } - #endif + osx_foreground_hack(); if(!mpGLView) { diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c index 66f73f1d6d..defede12ad 100644 --- a/libvo/vo_dxr2.c +++ b/libvo/vo_dxr2.c @@ -35,7 +35,7 @@ #include "mp_msg.h" #include "m_option.h" #include "sub.h" -#include "get_path.h" +#include "path.h" #include "libmpdemux/mpeg_packetizer.h" #include "x11_common.h" diff --git a/libvo/vo_kva.c b/libvo/vo_kva.c index 605d3730cb..07f6629769 100644 --- a/libvo/vo_kva.c +++ b/libvo/vo_kva.c @@ -60,7 +60,7 @@ static const vo_info_t info = { "" }; -LIBVO_EXTERN(kva) +const LIBVO_EXTERN(kva) #define WC_MPLAYER "WC_MPLAYER" diff --git a/libvo/vo_matrixview.c b/libvo/vo_matrixview.c index 7cc142a071..496d122a4c 100644 --- a/libvo/vo_matrixview.c +++ b/libvo/vo_matrixview.c @@ -44,7 +44,7 @@ static const vo_info_t info = { "Based on MatrixView from rss-glx.sf.net" }; -LIBVO_EXTERN(matrixview) +const LIBVO_EXTERN(matrixview) static MPGLContext glctx; diff --git a/libvo/vo_quartz.c b/libvo/vo_quartz.c index 42c9eb4ed4..5c06adf437 100644 --- a/libvo/vo_quartz.c +++ b/libvo/vo_quartz.c @@ -1088,27 +1088,7 @@ static int preinit(const char *arg) } } -#if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL) - // this chunk of code is heavily based off SDL_macosx.m from SDL - // the CPSEnableForegroundOperation that was here before is private and shouldn't be used - // replaced by a call to the 10.3+ TransformProcessType - { - ProcessSerialNumber myProc, frProc; - Boolean sameProc; - - if (GetFrontProcess(&frProc) == noErr) - { - if (GetCurrentProcess(&myProc) == noErr) - { - if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc) - { - TransformProcessType(&myProc, kProcessTransformToForegroundApplication); - } - SetFrontProcess(&myProc); - } - } - } -#endif + osx_foreground_hack(); return 0; } diff --git a/libvo/vo_wii.c b/libvo/vo_wii.c index 8999852d80..148e641bdb 100644 --- a/libvo/vo_wii.c +++ b/libvo/vo_wii.c @@ -61,7 +61,7 @@ static const vo_info_t info = { "" }; -LIBVO_EXTERN(wii) +const LIBVO_EXTERN(wii) static signed int pre_init_err = -2; diff --git a/loader/drv.c b/loader/drv.c index 13945538d2..fbc4007734 100644 --- a/loader/drv.c +++ b/loader/drv.c @@ -25,12 +25,7 @@ #ifndef __MINGW32__ #include "ext.h" #endif - -#ifndef WIN32_LOADER -char* def_path = BINARY_CODECS_PATH; -#else -extern char* def_path; -#endif +#include "path.h" #if 1 @@ -65,21 +60,6 @@ extern char* def_path; "pop %%ebx\n\t"::) #endif -static int needs_free=0; -void SetCodecPath(const char* path) -{ - if(needs_free)free(def_path); - if(path==0) - { - def_path = BINARY_CODECS_PATH; - needs_free=0; - return; - } - def_path = malloc(strlen(path)+1); - strcpy(def_path, path); - needs_free=1; -} - static DWORD dwDrvID = 0; LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message, diff --git a/loader/drv.h b/loader/drv.h index 9ae1f8fbec..6f20b8ce54 100644 --- a/loader/drv.h +++ b/loader/drv.h @@ -9,7 +9,6 @@ #include "wine/windef.h" #include "wine/driver.h" -void SetCodecPath(const char* path); void CodecAlloc(void); void CodecRelease(void); diff --git a/loader/elfdll.c b/loader/elfdll.c index e4a0190f89..057fa5b9c8 100644 --- a/loader/elfdll.c +++ b/loader/elfdll.c @@ -18,6 +18,7 @@ #include "wine/debugtools.h" #include "wine/winerror.h" #include "debug.h" +#include "path.h" //DEFAULT_DEBUG_CHANNEL(elfdll) @@ -37,9 +38,6 @@ DWORD fixup_imports(WINE_MODREF *wm); void dump_exports(HMODULE hModule); /*---------------- END HACKS ---------------*/ -//char *extra_ld_library_path = "/usr/lib/win32"; -extern char* def_path; - struct elfdll_image { HMODULE pe_module_start; @@ -68,7 +66,7 @@ void *ELFDLL_dlopen(const char *libname, int flags) /* Now try to construct searches through our extra search-path */ namelen = strlen(libname); - ldpath = def_path; + ldpath = codec_path; while(ldpath && *ldpath) { int len; diff --git a/loader/module.c b/loader/module.c index 79c01270d3..b9dcfa5869 100644 --- a/loader/module.c +++ b/loader/module.c @@ -46,6 +46,7 @@ #endif #include "win32.h" #include "drv.h" +#include "path.h" #ifdef EMU_QTX_API #include "wrapper.h" @@ -365,8 +366,7 @@ static WIN_BOOL MODULE_FreeLibrary( WINE_MODREF *wm ) HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) { WINE_MODREF *wm = 0; - char* listpath[] = { "", "", "/usr/lib/win32", "/usr/local/lib/win32", 0 }; - extern char* def_path; + char* listpath[] = { "", "", 0 }; char path[512]; char checked[2000]; int i = -1; @@ -393,9 +393,9 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) strncpy(path, libname, 511); else /* check default user path */ - strncpy(path, def_path, 300); + strncpy(path, codec_path, 300); } - else if (strcmp(def_path, listpath[i])) + else if (strcmp(codec_path, listpath[i])) /* path from the list */ strncpy(path, listpath[i], 300); else diff --git a/loader/registry.c b/loader/registry.c index 9964eeb9ff..cab63ceb72 100644 --- a/loader/registry.c +++ b/loader/registry.c @@ -21,7 +21,7 @@ #include "ext.h" #include "registry.h" -#include "get_path.h" +#include "path.h" //#undef TRACE //#define TRACE printf diff --git a/loader/win32.c b/loader/win32.c index d0cbddca66..0b1999a043 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -49,6 +49,7 @@ for DLL to know too much about its environment. #include "loader.h" #include "com.h" #include "ext.h" +#include "path.h" #include #include @@ -77,8 +78,6 @@ for DLL to know too much about its environment. #include "osdep/mmap_anon.h" #include "libavutil/avstring.h" -char* def_path = BINARY_CODECS_PATH; - static void do_cpuid(unsigned int ax, unsigned int *regs) { __asm__ volatile @@ -146,7 +145,7 @@ static void longcount_stub(long long*); static unsigned int (*localcount)()=localcount_stub; static void (*longcount)(long long*)=longcount_stub; -static pthread_mutex_t memmut; +static pthread_mutex_t memmut = PTHREAD_MUTEX_INITIALIZER; static unsigned int localcount_stub(void) { @@ -366,14 +365,9 @@ void* mreq_private(int size, int to_zero, int type) if (to_zero) memset(header, 0, nsize); #ifdef GARBAGE - if (!last_alloc) + pthread_mutex_lock(&memmut); + if (last_alloc) { - pthread_mutex_init(&memmut, NULL); - pthread_mutex_lock(&memmut); - } - else - { - pthread_mutex_lock(&memmut); last_alloc->next = header; /* set next */ } @@ -442,10 +436,7 @@ static int my_release(void* memory) alccnt--; - if (last_alloc) - pthread_mutex_unlock(&memmut); - else - pthread_mutex_destroy(&memmut); + pthread_mutex_unlock(&memmut); //if (alccnt < 40000) printf("MY_RELEASE: %p\t%ld (%d)\n", header, header->size, alccnt); #else @@ -1182,13 +1173,6 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si) } } fclose (f); - /* - * ad hoc fix for smp machines. - * some problems on WaitForSingleObject,CreateEvent,SetEvent - * CreateThread ...etc.. - * - */ - cachedsi.dwNumberOfProcessors=1; } #endif /* __linux__ */ cache = 1; @@ -1814,47 +1798,31 @@ static long WINAPI expWideCharToMultiByte(long v1, long v2, short* s1, long siz1 static long WINAPI expGetVersionExA(OSVERSIONINFOA* c) { - dbgprintf("GetVersionExA(0x%x) => 1\n"); + dbgprintf("GetVersionExA(0x%x) => 1\n", c); c->dwOSVersionInfoSize=sizeof(*c); - c->dwMajorVersion=4; - c->dwMinorVersion=0; - c->dwBuildNumber=0x4000457; -#if 1 - // leave it here for testing win9x-only codecs - c->dwPlatformId=VER_PLATFORM_WIN32_WINDOWS; - strcpy(c->szCSDVersion, " B"); -#else - c->dwPlatformId=VER_PLATFORM_WIN32_NT; // let's not make DLL assume that it can read CR* registers - strcpy(c->szCSDVersion, "Service Pack 3"); -#endif - dbgprintf(" Major version: 4\n Minor version: 0\n Build number: 0x4000457\n" - " Platform Id: VER_PLATFORM_WIN32_NT\n Version string: 'Service Pack 3'\n"); + c->dwMajorVersion=5; + c->dwMinorVersion=1; + c->dwBuildNumber=0x5010a28; + c->dwPlatformId=VER_PLATFORM_WIN32_NT; + strcpy(c->szCSDVersion, "Service Pack 2"); + dbgprintf(" Major version: 5\n Minor version: 1\n Build number: 0x5010a28\n" + " Platform Id: VER_PLATFORM_WIN32_NT\n Version string: 'Service Pack 2'\n"); return 1; } static long WINAPI expGetVersionExW(OSVERSIONINFOW* c) { char CSDVersion[128]; - dbgprintf("GetVersionExW(0x%x) => 1\n"); + dbgprintf("GetVersionExW(0x%x) => 1\n", c); c->dwOSVersionInfoSize=sizeof(*c); c->dwMajorVersion=5; - c->dwMinorVersion=0; - c->dwBuildNumber=0x5000457; -#if 1 - // leave it here for testing win9x-only codecs - c->dwPlatformId=VER_PLATFORM_WIN32_WINDOWS; - strcpy(CSDVersion, " B"); -#else - c->dwPlatformId=VER_PLATFORM_WIN32_NT; // let's not make DLL assume that it can read CR* registers - strcpy(CSDVersion, "Service Pack 3"); -#endif + c->dwMinorVersion=1; + c->dwBuildNumber=0x5010a28; + c->dwPlatformId=VER_PLATFORM_WIN32_NT; + strcpy(CSDVersion, "Service Pack 2"); MultiByteToWideChar(65001, 0x0, CSDVersion, -1, c->szCSDVersion, 128); - dbgprintf(" Major version: %d\n Minor version: %d\n Build number: 0x%08x\n" - " Platform Id: %s\n Version string: '%s'\n", - c->dwMajorVersion, c->dwMinorVersion, c->dwBuildNumber, - (c->dwPlatformId==VER_PLATFORM_WIN32_WINDOWS ? "VER_PLATFORM_WIN32_WINDOWS" : - (c->dwPlatformId==VER_PLATFORM_WIN32_NT ? "VER_PLATFORM_WIN32_NT" : "Unknown")), - CSDVersion); + dbgprintf(" Major version: 5\n Minor version: 1\n Build number: 0x5010a28\n" + " Platform Id: VER_PLATFORM_WIN32_NT\n Version string: 'Service Pack 2'\n"); return 1; } @@ -2604,7 +2572,8 @@ static int WINAPI expLoadLibraryA(char* name) return MODULE_HANDLE_psapi; result=LoadLibraryA(name); - dbgprintf("Returned LoadLibraryA(0x%x='%s'), def_path=%s => 0x%x\n", name, name, def_path, result); + dbgprintf("Returned LoadLibraryA(0x%x='%s'), codec_path=%s => 0x%x\n", + name, name, codec_path, result); return result; } @@ -3618,13 +3587,15 @@ static HANDLE WINAPI expFindFirstFileA(LPCSTR s, LPWIN32_FIND_DATAA lpfd) #ifdef CONFIG_QTX_CODECS if(strstr(s, "quicktime\\*.QTX")){ dbgprintf("FindFirstFileA(0x%x='%s', 0x%x) => QTX\n", s, s, lpfd); - dbgprintf("\n### Searching for QuickTime plugins (*.qtx) at %s...\n",def_path); - qtx_dir=opendir(def_path); + dbgprintf("\n### Searching for QuickTime plugins (*.qtx) at %s...\n", + codec_path); + qtx_dir = opendir(codec_path); if(!qtx_dir) return (HANDLE)-1; memset(lpfd,0,sizeof(*lpfd)); if(expFindNextFileA(FILE_HANDLE_quicktimeqtx,lpfd)) return FILE_HANDLE_quicktimeqtx; - printf("loader: Couldn't find the QuickTime plugins (.qtx files) at %s\n",def_path); + printf("loader: Couldn't find the QuickTime plugins (.qtx files) at %s\n", + codec_path); return (HANDLE)-1; } #if 0 @@ -3761,8 +3732,8 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2, if(strstr(cs1, "QuickTime.qts")) { int result; - char* tmp=malloc(strlen(def_path)+50); - strcpy(tmp, def_path); + char* tmp = malloc(strlen(codec_path) + 50); + strcpy(tmp, codec_path); strcat(tmp, "/"); strcat(tmp, "QuickTime.qts"); result=open(tmp, O_RDONLY); @@ -3772,9 +3743,9 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2, if(strstr(cs1, ".qtx")) { int result; - char* tmp=malloc(strlen(def_path)+250); + char* tmp = malloc(strlen(codec_path) + 250); char* x=strrchr(cs1,'\\'); - sprintf(tmp,"%s/%s",def_path,x?(x+1):cs1); + sprintf(tmp, "%s/%s", codec_path, x ? (x + 1) : cs1); // printf("### Open: %s -> %s\n",cs1,tmp); result=open(tmp, O_RDONLY); free(tmp); @@ -3785,8 +3756,8 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2, if(strncmp(cs1, "AP", 2) == 0) { int result; - char* tmp=malloc(strlen(def_path)+50); - strcpy(tmp, def_path); + char* tmp = malloc(strlen(codec_path) + 50); + strcpy(tmp, codec_path); strcat(tmp, "/"); strcat(tmp, "APmpg4v1.apl"); result=open(tmp, O_RDONLY); diff --git a/loader/wine/elfdll.h b/loader/wine/elfdll.h index 82a6ea1f8d..e93ae10429 100644 --- a/loader/wine/elfdll.h +++ b/loader/wine/elfdll.h @@ -9,6 +9,5 @@ HINSTANCE16 ELFDLL_LoadModule16(LPCSTR libname); void ELFDLL_UnloadLibrary(WINE_MODREF *wm); void *ELFDLL_dlopen(const char *libname, int flags); -extern char *extra_ld_library_path; #endif /* MPLAYER_ELFDLL_H */ diff --git a/mencoder.c b/mencoder.c index d449572851..dc3d8700a3 100644 --- a/mencoder.c +++ b/mencoder.c @@ -63,11 +63,7 @@ #include "parser-mecmd.h" #include "parser-cfg.h" #include "mp_fifo.h" -#include "get_path.h" - -#ifdef CONFIG_WIN32DLL -#include "loader/drv.h" // for SetCodecPath() -#endif +#include "path.h" #include "stream/stream.h" #include "libmpdemux/aviprint.h" @@ -341,7 +337,7 @@ static void exit_sighandler(int x){ static muxer_t* muxer=NULL; -void add_subtitles(char *filename, float fps, int silent) +static void add_subtitles(char *filename, float fps, int silent) { sub_data *subd; #ifdef CONFIG_ASS @@ -684,10 +680,8 @@ if (frameno_filename) { set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) - SetCodecPath(codec_path); -#endif + set_codec_path(codec_path); // check font #ifdef CONFIG_FREETYPE diff --git a/mpcommon.c b/mpcommon.c index 789556578a..61d61c743c 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -315,7 +315,3 @@ const m_option_t noconfig_opts[] = { {NULL, NULL, 0, 0, 0, 0, NULL} }; -#ifdef CONFIG_WIN32DLL -char *codec_path = NULL; -#endif - diff --git a/mpcommon.h b/mpcommon.h index 42ec62fcf7..d7894edf06 100644 --- a/mpcommon.h +++ b/mpcommon.h @@ -39,8 +39,4 @@ void set_osd_subtitle(struct MPContext *mpctx, subtitle *subs); extern int disable_system_conf; extern int disable_user_conf; -#ifdef CONFIG_WIN32DLL -extern char *codec_path; -#endif - #endif /* MPLAYER_MPCOMMON_H */ diff --git a/mplayer.c b/mplayer.c index 836ae504ee..af4fd37d1e 100644 --- a/mplayer.c +++ b/mplayer.c @@ -97,10 +97,6 @@ #include "input/input.h" -#ifdef CONFIG_WIN32DLL -#include "loader/drv.h" // for SetCodecPath() -#endif - const int under_mencoder = 0; int slave_mode=0; int player_idle_mode=0; @@ -149,7 +145,7 @@ char *heartbeat_cmd; static int cfg_inc_verbose(m_option_t *conf){ ++verbose; return 0;} -#include "get_path.h" +#include "path.h" //**************************************************************************// //**************************************************************************// @@ -3146,10 +3142,8 @@ int i; set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) - SetCodecPath(codec_path); -#endif + set_codec_path(codec_path); if(opts->video_driver_list && strcmp(opts->video_driver_list[0],"help")==0){ list_video_out(); diff --git a/get_path.c b/path.c similarity index 92% rename from get_path.c rename to path.c index ad3c422639..2a1d504ce3 100644 --- a/get_path.c +++ b/path.c @@ -28,7 +28,7 @@ #include #include "config.h" #include "mp_msg.h" -#include "get_path.h" +#include "path.h" #ifdef CONFIG_MACOSX_BUNDLE #include @@ -175,3 +175,21 @@ void set_path_env(void) mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); } #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ + +char *codec_path = BINARY_CODECS_PATH; + +static int needs_free = 0; + +void set_codec_path(const char *path) +{ + if (needs_free) + free(codec_path); + if (path == 0) { + codec_path = BINARY_CODECS_PATH; + needs_free = 0; + return; + } + codec_path = malloc(strlen(path) + 1); + strcpy(codec_path, path); + needs_free = 1; +} diff --git a/get_path.h b/path.h similarity index 85% rename from get_path.h rename to path.h index 2f1909b601..3e71120458 100644 --- a/get_path.h +++ b/path.h @@ -18,10 +18,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MPLAYER_GET_PATH_H -#define MPLAYER_GET_PATH_H +#ifndef MPLAYER_PATH_H +#define MPLAYER_PATH_H + +extern char *codec_path; char *get_path(const char *filename); void set_path_env(void); +void set_codec_path(const char *path); -#endif /* MPLAYER_GET_PATH_H */ +#endif /* MPLAYER_PATH_H */ diff --git a/stream/network.c b/stream/network.c index 537555f73a..a7528af4ad 100644 --- a/stream/network.c +++ b/stream/network.c @@ -298,7 +298,10 @@ http_read_response( int fd ) { } http_response_append( http_hdr, response, i ); } while( !http_is_header_entire( http_hdr ) ); - http_response_parse( http_hdr ); + if (http_response_parse( http_hdr ) < 0) { + http_free( http_hdr ); + return NULL; + } return http_hdr; } diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index f7ef473eed..c2e34d3d35 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -43,7 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "libmpdemux/demuxer.h" #include "m_option.h" #include "m_struct.h" -#include "get_path.h" +#include "path.h" #include "libavutil/avstring.h" #include "dvbin.h"