From 98074f2b4e6e2c8858c7c6bd7605208e60993cb1 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 20:56:17 +0000 Subject: [PATCH 01/58] HAVE_LRINT and friends should be defined to 0/1. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28404 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 4ff74eb382..0d24b51b5d 100755 --- a/configure +++ b/configure @@ -2839,7 +2839,7 @@ if eval test "x\$_$func" = "xyes"; then eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\"" echores yes else - eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\"" + eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 0\"" echores no fi done From 693c550d05fc9abec4d73d0923625e15d1f439be Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 21:16:54 +0000 Subject: [PATCH 02/58] Add #define HAVE_DLFCN_H to config.h, libdvdread4 needs it. Fixes Bugzilla #1399. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28405 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 0d24b51b5d..cabb4cafa7 100755 --- a/configure +++ b/configure @@ -8260,7 +8260,7 @@ $_def_fast_inttypes #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TYPES_H 1 /* libdvdread */ -#define HAVE_UINTPTR_T 1 +#define HAVE_DLFCN_H 1 /* system headers */ From c98fd985c2bda96ac15b8892be75d5cc85861928 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 22:34:52 +0000 Subject: [PATCH 03/58] Add bswap check, needed for FFmpeg. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28406 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index cabb4cafa7..38e3925c46 100755 --- a/configure +++ b/configure @@ -2495,6 +2495,12 @@ else _have_yasm="no" echores "no" fi + +echocheck "bswap" +def_bswap='#define HAVE_BSWAP 0' +echo 'bswap %eax' > $TMPS +$_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no +echores "$bswap" fi #if x86 @@ -8577,6 +8583,7 @@ $_def_libswscale $_def_libswscale_a $_def_libswscale_so +$def_bswap $_def_dcbzl $def_fast_64bit $_def_fast_unaligned From 83f2da06c3b8546f5ce5b45e22fa7a42419dd1e2 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 22:37:12 +0000 Subject: [PATCH 04/58] Make sure HAVE_FAST_64BIT is always #defined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28407 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 38e3925c46..9267bbc92a 100755 --- a/configure +++ b/configure @@ -1685,6 +1685,7 @@ EOF fi +def_fast_64bit='#define HAVE_FAST_64BIT 0' _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM SH4 PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC' case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) From 4c4dc61228af59be595fb542eaa1636005b61948 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 22:37:53 +0000 Subject: [PATCH 05/58] Make sure HAVE_ALTIVEC_H is always #defined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28408 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 9267bbc92a..7ae2374993 100755 --- a/configure +++ b/configure @@ -2506,6 +2506,7 @@ fi #if x86 #FIXME: This should happen before the check for CFLAGS.. +def_altivec_h='#define HAVE_ALTIVEC_H 0' if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then # check if AltiVec is supported by the compiler, and how to enable it @@ -2516,7 +2517,6 @@ EOF if $(cc_check -maltivec -mabi=altivec) ; then _altivec_gcc_flags="-maltivec -mabi=altivec" # check if should be included - def_altivec_h='#undef HAVE_ALTIVEC_H' cat > $TMPC << EOF #include int main(void) { return 0; } From 261ee578ee82e223d92b4c0896afc64815960f0d Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 22:45:18 +0000 Subject: [PATCH 06/58] Make sure CONFIG_MEMALIGN_HACK is always #defined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28409 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 7ae2374993..49a31d843b 100755 --- a/configure +++ b/configure @@ -3128,6 +3128,7 @@ echores "$_malloc" echocheck "memalign()" # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ? +_def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0' cat > $TMPC << EOF #include int main(void) { (void) memalign(64, sizeof(char)); return 0; } From e7ecd5119a9e537a94f0fa6b1fe9289a40c23c5f Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 22:46:12 +0000 Subject: [PATCH 07/58] Slightly simplify VIDIX_PCI_FILES command. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28410 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ccac3e058e..e56edd6922 100644 --- a/Makefile +++ b/Makefile @@ -869,8 +869,8 @@ vidix/%: CFLAGS += $(CFLAGS_DHAHELPER) $(CFLAGS_SVGALIB_HELPER) VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_names.c \ vidix/pci_names.h vidix/pci_vendors.h -$(VIDIX_PCI_FILES): vidix/pci.db vidix/pci_db2c.awk - awk -f vidix/pci_db2c.awk $< $(VIDIX_PCIDB) +$(VIDIX_PCI_FILES): vidix/pci_db2c.awk vidix/pci.db + awk -f $^ $(VIDIX_PCIDB) VIDIX_DEPS = $(filter vidix/%,$(SRCS_MPLAYER:.c=.d)) VIDIX_OBJS = $(filter vidix/%,$(SRCS_MPLAYER:.c=.o)) From 5de6238a2699fc1aeecd1157dfe47d75b895a7c7 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 23:12:27 +0000 Subject: [PATCH 08/58] cosmetics: Move memalign_hack define next to other FFmpeg defines in config.h. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28411 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 49a31d843b..75facadb9a 100755 --- a/configure +++ b/configure @@ -8297,7 +8297,6 @@ $_def_lrint $_def_lrintf $_def_map_memalign $_def_memalign -$_def_memalign_hack $_def_nanosleep $_def_posix_select $_def_round @@ -8589,6 +8588,7 @@ $def_bswap $_def_dcbzl $def_fast_64bit $_def_fast_unaligned +$_def_memalign_hack $def_mlib $_def_mkstemp $_def_pthreads From 83ebcb0db73fbf436c0fe9a0d37e67f875b73c83 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 31 Jan 2009 23:19:16 +0000 Subject: [PATCH 09/58] Set a sane default path on Solaris. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28412 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index 75facadb9a..7c95c8bbca 100755 --- a/configure +++ b/configure @@ -190,6 +190,9 @@ echores() { } ############################################################################# +# Solaris has broken stone-age tools in the standard locations +sunos && test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH + # Check how echo works in this /bin/sh case `echo -n` in -n) _echo_n= _echo_c='\c' ;; # SysV echo From 43744a2d0f725a3dd45e299d2fbc1b9966399e81 Mon Sep 17 00:00:00 2001 From: compn Date: Sun, 1 Feb 2009 00:00:21 +0000 Subject: [PATCH 10/58] increase max OSD message size limit patch by Scaevolus on irc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28413 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mplayer.c b/mplayer.c index dd9e9dc699..a6c57c0c40 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1325,7 +1325,7 @@ struct mp_osd_msg { /// Previous message on the stack. mp_osd_msg_t* prev; /// Message text. - char msg[64]; + char msg[128]; int id,level,started; /// Display duration in ms. unsigned time; @@ -1362,9 +1362,9 @@ void set_osd_msg(int id, int level, int time, const char* fmt, ...) { } // write the msg va_start(va,fmt); - r = vsnprintf(msg->msg, 64, fmt, va); + r = vsnprintf(msg->msg, 128, fmt, va); va_end(va); - if(r >= 64) msg->msg[63] = 0; + if(r >= 128) msg->msg[127] = 0; // set id and time msg->id = id; msg->level = level; @@ -1505,8 +1505,8 @@ void set_osd_bar(int type,const char* name,double min,double max,double val) { static void update_osd_msg(void) { mp_osd_msg_t *msg; - static char osd_text[64] = ""; - static char osd_text_timer[64]; + static char osd_text[128] = ""; + static char osd_text_timer[128]; // we need some mem for vo_osd_text vo_osd_text = (unsigned char*)osd_text; @@ -1514,7 +1514,7 @@ static void update_osd_msg(void) { // Look if we have a msg if((msg = get_osd_msg())) { if(strcmp(osd_text,msg->msg)) { - strncpy((char*)osd_text, msg->msg, 63); + strncpy((char*)osd_text, msg->msg, 127); if(mpctx->sh_video) vo_osd_changed(OSDTYPE_OSD); else if(term_osd) mp_msg(MSGT_CPLAYER,MSGL_STATUS,"%s%s\n",term_osd_esc,msg->msg); } From 5e63efb850dc6501aae53a1c7418bc1cf3962f41 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 02:01:31 +0000 Subject: [PATCH 11/58] Use full internal pathname in doxygen @file directives. Otherwise doxygen complains about ambiguous filenames when files exist under the same name in different subdirectories. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28414 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 95ff4f1770..cee394f8a5 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -22,7 +22,7 @@ #define SWSCALE_SWSCALE_H /** - * @file swscale.h + * @file libswscale/swscale.h * @brief * external api for the swscale stuff */ From 56d9a23ee9a4623e498f644eddd721a423264ce5 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 02:10:31 +0000 Subject: [PATCH 12/58] Add support for libavcodec GMC flag, patch by Dave Baker, dbkr mxtelecom com. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28415 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 4 ++++ libmpcodecs/ve_lavc.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index deccef7e73..73ae4b1df4 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -9102,6 +9102,10 @@ Currently it only works if scene change detection is disabled (sc_threshold=1000000000). . .TP +.B "gmc\ \ \ \ " +Enable Global Motion Compensation. +. +.TP .B (no)lowdelay Sets the low delay flag for MPEG-1/2 (disables B-frames). . diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index 9c94c1d1f9..bbb5d69ed1 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -113,6 +113,7 @@ static int lavc_param_bit_exact = 0; static int lavc_param_aic= 0; static int lavc_param_aiv= 0; static int lavc_param_umv= 0; +static int lavc_param_gmc= 0; static int lavc_param_obmc= 0; static int lavc_param_loop= 0; static int lavc_param_last_pred= 0; @@ -282,6 +283,9 @@ m_option_t lavcopts_conf[]={ #endif #ifdef CODEC_FLAG_CLOSED_GOP {"cgop", &lavc_param_closed_gop, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP, NULL}, +#endif +#ifdef CODEC_FLAG_GMC + {"gmc", &lavc_param_gmc, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC, NULL}, #endif {"dc", &lavc_param_dc_precision, CONF_TYPE_INT, CONF_RANGE, 8, 11, NULL}, {"border_mask", &lavc_param_border_masking, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL}, @@ -555,6 +559,7 @@ static int config(struct vf_instance_s* vf, lavc_venc_context->flags|= lavc_param_ss; lavc_venc_context->flags|= lavc_param_alt; lavc_venc_context->flags|= lavc_param_ilme; + lavc_venc_context->flags|= lavc_param_gmc; #ifdef CODEC_FLAG_CLOSED_GOP lavc_venc_context->flags|= lavc_param_closed_gop; #endif From 917aadbba68c90c626adf233313d1d5aa639f965 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 02:22:56 +0000 Subject: [PATCH 13/58] Add CONFIG_FASTDIV and CONFIG_POWERPC_PERF to config.h for FFmpeg compilation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28416 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 7c95c8bbca..194b8d8eb4 100755 --- a/configure +++ b/configure @@ -8598,7 +8598,9 @@ $_def_pthreads $_def_threads $_def_yasm +#define CONFIG_FASTDIV 0 #define CONFIG_GPL 1 +#define CONFIG_POWERPC_PERF 0 #define CONFIG_SMALL 0 #define CONFIG_SWSCALE 1 #define CONFIG_GRAY 0 From 7e51b9b7098f09fffbd0aabcb0b8c404e6533dbc Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 10:43:28 +0000 Subject: [PATCH 14/58] Update binutils and compiler sections. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28417 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/install.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DOCS/xml/en/install.xml b/DOCS/xml/en/install.xml index fae3bd8618..ab2dd2361d 100644 --- a/DOCS/xml/en/install.xml +++ b/DOCS/xml/en/install.xml @@ -26,13 +26,13 @@ answers. - binutils - recommended version is - 2.11.x. + binutils - GNU binutils 2.11 or later + is known to work. - gcc - recommended versions are 2.95 - and 3.4+. 2.96 and 3.0.x are known to generate faulty code, 3.1 and - 3.2 also had problems, 3.3 some minor ones. On PowerPC, use 4.x. + compiler - We mostly use gcc, the + recommended versions on x86 are 2.95 and 3.4+. On PowerPC, use 4.x+. + icc 10.1+ is also known to work. Xorg/XFree86 - recommended version is From d99b77f49f90150ed5576ab91e445505e0526ec9 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 10:44:04 +0000 Subject: [PATCH 15/58] Move GNU Make entry to the top of the list. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28418 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/install.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DOCS/xml/en/install.xml b/DOCS/xml/en/install.xml index ab2dd2361d..10d266f31e 100644 --- a/DOCS/xml/en/install.xml +++ b/DOCS/xml/en/install.xml @@ -25,6 +25,9 @@ answers. Software requirements + + GNU make 3.81 or later + binutils - GNU binutils 2.11 or later is known to work. @@ -41,9 +44,6 @@ answers. too, otherwise it won't work. You don't absolutely need X, some video output drivers work without it. - - GNU make 3.81 - FreeType - 2.0.9 or later is required for the OSD and subtitles From 7df31bf8d2ed57dad7108928d831c89bcbf5b16e Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 11:15:18 +0000 Subject: [PATCH 16/58] Remove remarks about GNU Make being required on some systems. GNU Make 3.81 or later is required everywhere. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28419 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 29ed6bd422..7723eff1ae 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -109,11 +109,6 @@ There are ports/pkgsrc/fink/etc versions of MPlayer available that are probably easier to use than our raw sources. - -To build MPlayer you will need GNU make -(gmake - native BSD make will not work) and a recent version of binutils. - - If MPlayer complains about not finding /dev/cdrom or /dev/dvd, @@ -222,17 +217,6 @@ installed. - -To build the package you will need GNU make -(gmake, /opt/sfw/gmake), native -Solaris make will not work. Typical error you get when building with -Solaris' make instead of GNU make: - -% /usr/ccs/bin/make -make: Fatal error in reader: Makefile, line 25: Unexpected end of line seen - - - On Solaris SPARC, you need the GNU C/C++ Compiler; it does not matter if GNU C/C++ compiler is configured with or without the GNU assembler. @@ -378,7 +362,7 @@ work out of the box. The following information is taken from this HOWTO. -You need GCC 3.4.0 or later, GNU make 3.80 or later and SDL 1.2.7 or later. +You need GCC 3.4.0 or later and SDL 1.2.7 or later. HP cc will not produce a working program, prior GCC versions are buggy. For OpenGL functionality you need to install Mesa and the gl and gl2 video output drivers should work, speed may be very bad, depending on the CPU speed, @@ -489,13 +473,6 @@ untested. It is highly recommended that you build or if you are building on POWER5, GCC 4.0 is required. - -Ensure that you are using GNU make -(/opt/freeware/bin/gmake) to build -MPlayer, as you will encounter problems if -you use /usr/ccs/bin/make. - - CPU detection is still a work in progress. The following architectures have been tested: From 6f28c3500baaf183cdf932475059e4b3d40a2a60 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 11:27:16 +0000 Subject: [PATCH 17/58] Add a note about adding /usr/xpg4/bin to your PATH on Solaris. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28420 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 7723eff1ae..048a8ba224 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -182,6 +182,13 @@ adjustments to make the build work. Solaris + +Solaris still has broken, POSIX-incompatible system tools and shell in default +locations. Until a bold step out of the computing stone age is made, you will +have to add /usr/xpg4/bin to your +PATH. + + MPlayer should work on Solaris 2.6 or newer. Use the SUN audio driver with the option for sound. From 6053ca62bb31df3dacb6e64c361b03d196f67dfd Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 11:28:31 +0000 Subject: [PATCH 18/58] Revert Solaris PATH modification workaround. It is incomplete anyway and configure should not fiddle with user configuration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28421 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure b/configure index 194b8d8eb4..4f6ba8fc85 100755 --- a/configure +++ b/configure @@ -190,9 +190,6 @@ echores() { } ############################################################################# -# Solaris has broken stone-age tools in the standard locations -sunos && test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH - # Check how echo works in this /bin/sh case `echo -n` in -n) _echo_n= _echo_c='\c' ;; # SysV echo From 3fd161fcc7e16b83f48e0443d2ef3f2357c1a36d Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 11:29:18 +0000 Subject: [PATCH 19/58] Add a note about POSIX system requirements. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28422 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/install.xml | 5 +++++ README | 2 ++ 2 files changed, 7 insertions(+) diff --git a/DOCS/xml/en/install.xml b/DOCS/xml/en/install.xml index 10d266f31e..257ca635c3 100644 --- a/DOCS/xml/en/install.xml +++ b/DOCS/xml/en/install.xml @@ -25,6 +25,11 @@ answers. Software requirements + + POSIX system - You need a POSIX-compatible + shell and POSIX-compatible system tools like grep, sed, awk, etc. in your + path. + GNU make 3.81 or later diff --git a/README b/README index 62e6d7b7a9..7b202ba38e 100644 --- a/README +++ b/README @@ -16,6 +16,8 @@ Also read the man page to learn how to use MPlayer. Requirements: +- POSIX system: You need a POSIX-compatible shell and POSIX-compatible system + tools like grep, sed, awk, etc. in your path. - You need a working development environment that can compile programs. On popular Linux distributions, this means having the glibc development package(s) installed. From 74a216ea560ab1f17f526b89731ef3ddca7c476e Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 11:32:58 +0000 Subject: [PATCH 20/58] Remove -c option from install commands. It is ignored by GNU install and incompatible with some other install commands. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28423 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e56edd6922..7d30bc59b1 100644 --- a/Makefile +++ b/Makefile @@ -903,7 +903,7 @@ install-mencoder-man-en: install-mplayer-man-en install-mplayer-man-en: $(INSTALL) -d $(MANDIR)/man1 - $(INSTALL) -c -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/ + $(INSTALL) -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/ define MENCODER_MAN_RULE install-mencoder-man-$(lang): install-mplayer-man-$(lang) @@ -913,7 +913,7 @@ endef define MPLAYER_MAN_RULE install-mplayer-man-$(lang): $(INSTALL) -d $(MANDIR)/$(lang)/man1 - $(INSTALL) -c -m 644 DOCS/man/$(lang)/mplayer.1 $(MANDIR)/$(lang)/man1/ + $(INSTALL) -m 644 DOCS/man/$(lang)/mplayer.1 $(MANDIR)/$(lang)/man1/ endef $(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(MENCODER_MAN_RULE))) From 085d2a488df757c578fbd0f334c88ff5e39c8740 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 11:34:31 +0000 Subject: [PATCH 21/58] Remove IRIX section, the advice it contained is now obsolete. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28424 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 048a8ba224..8c7f123144 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -330,34 +330,6 @@ you may not be able to play DVD discs larger than 4 GB: - -IRIX - - -You can either try to install the GNU install program, and (if you did -not put it in your global path) then point to the location with: - -./configure --with-install=/path/and/name/of/install - - - - -Or you can use the default install delivered with IRIX 6.5 in which case -you will have to edit the Makefile by hand a little bit. -Change the line: - -$(INSTALL) -c -m 644 DOCS/mplayer.1 $(MANDIR)/man1/mplayer.1 - -to: - -$(INSTALL) -m 644 mplayer.1 $(MANDIR)/man1/ - -and then go on with building and installing. - - - - - HP-UX From 8a2a9024a097da9b638193a4c9e3fe42f599a74c Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 11:46:55 +0000 Subject: [PATCH 22/58] Remove hints about specific binary packages, add a link to the list of unofficial packages on our homepage instead. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28425 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 8c7f123144..d3b6fc8c44 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -7,10 +7,10 @@ Linux -The main development platform is Linux on x86, although -MPlayer works on many other Linux ports. Binary packages of MPlayer are available from several -sources. +sources. We have a list of places to get +unofficial packages +for various distributions on our homepage. However, none of these packages are supported. Report problems to the authors, not to us. @@ -45,13 +45,6 @@ As root you can then install the .deb package as usual: dpkg -i ../mplayer_version.deb - - -Christian Marillat has been making unofficial Debian packages of -MPlayer, MEncoder and -our binary codec packages for a while, you can (apt-)get them from -his homepage. - @@ -64,15 +57,6 @@ Dominik Mierzejewski maintains the official RPM packages of MPlayer for Fedora and CentOS/RHEL. They are available from RPMFusion repository. - - -Mandrake/Mandriva RPM packages are available from the -P.L.F.. -SUSE used to include a crippled version of MPlayer -in their distribution. They have removed it in their latest releases. You can -get working RPMs from -links2linux.de. - From 11128efa7db19082116b23723916f1a8f0c36934 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 12:36:22 +0000 Subject: [PATCH 23/58] Remove Amiga/MorphOS section, it only contained outdated information. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28426 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index d3b6fc8c44..62cfdd61d5 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -852,41 +852,6 @@ The output will be even slower than on Linux, since QNX has only X emulation which is very slow. - - - - -Amiga/MorphOS (GeekGadgets) - -The people over at -www.amigasoft.net -make current MPlayer and -MEncoder packages. - - - -Nicholas Det at Genesi has done a big and powerful port of MPlayer - for MorphOS. Sadly it's based on the 0.90 series. - - - -Get if from MorphZone: - - - - MPlayer 0.91 binary - - - - MPlayer 0.91 source - - - - MEncoder 1.0pre3 binary - - - - From 8aca040356ee1204799d135c91e974636fc4d98c Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 12:38:02 +0000 Subject: [PATCH 24/58] Reword beginning of MinGW section. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28427 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 62cfdd61d5..04ef50f007 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -635,11 +635,9 @@ Instructions and files for making SDL run under <application>MinGW</application> -Installing a version of MinGW that could -compile MPlayer used to be quite tricky, but it -works out of the box now. Just install MinGW -3.1.0 or later and MSYS 1.0.9 or later and tell the MSYS postinstall that -MinGW is installed. +You need MinGW 3.1.0 or later and MSYS 1.0.9 or +later. Tell the MSYS postinstall that MinGW is +installed. From a9fb1482fdf71457fd149bfdc8188df5f49e71cd Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 12:42:39 +0000 Subject: [PATCH 25/58] Move note about binary packages to the top section. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28428 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 04ef50f007..b0a7907e48 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -3,18 +3,18 @@ Ports - -Linux - Binary packages of MPlayer are available from several sources. We have a list of places to get unofficial packages -for various distributions on our homepage. +for various systems on our homepage. However, none of these packages are supported. Report problems to the authors, not to us. + +Linux + From b81df16b9d37364efb3f7e9e147beaf6891206a4 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 12:49:10 +0000 Subject: [PATCH 26/58] Move QNX subsection to commercial Unix section. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28429 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 49 +++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index b0a7907e48..1ae83a50bf 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -489,6 +489,23 @@ Messages in the GTK-2 interface will be broken then. + + +QNX + + +You'll need to download and install SDL for QNX. Then run +MPlayer with +and options, it should be fast. + + + +The output will be even slower than on Linux, +since QNX has only X emulation which is very slow. + + @@ -820,36 +837,4 @@ not work anymore. - - - - - -Exotic Platforms - - -MPlayer runs on a number of exotic platforms, -but most of the platform-specific changes from those systems have not been -merged back into the main source tree. -For build instructions you should refer to the system-specific documentation. - - - - - -QNX - - -You'll need to download and install SDL for QNX. Then run -MPlayer with -and options, it should be fast. - - - -The output will be even slower than on Linux, -since QNX has only X emulation which is very slow. - - - - From 89fc99d8a07c0b02ee9ce95fbbf033aaa3ffda6e Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 12:52:38 +0000 Subject: [PATCH 27/58] CONFIG_LIB* are defined as 0/1 in FFmpeg. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28430 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 4f6ba8fc85..a0fb8a35ba 100755 --- a/configure +++ b/configure @@ -6364,7 +6364,7 @@ if test "$_faac" = yes ; then else _faac_lavc=no _def_faac="#undef CONFIG_FAAC" - _def_faac_lavc="#undef CONFIG_LIBFAAC" + _def_faac_lavc="#define CONFIG_LIBFAAC 0" _nocodecmodules="faac $_nocodecmodules" fi _res_comment="in libavcodec: $_faac_lavc" @@ -6923,7 +6923,7 @@ if test "$_xvid_lavc" = yes ; then _libavencoders="$_libavencoders LIBXVID_ENCODER" else _xvid_lavc=no - _def_xvid_lavc='#undef CONFIG_LIBXVID' + _def_xvid_lavc='#define CONFIG_LIBXVID 0' fi echores "$_xvid_lavc" @@ -6956,7 +6956,7 @@ if test "$_x264" = yes ; then else _x264_lavc=no _def_x264='#undef CONFIG_X264' - _def_x264_lavc='#undef CONFIG_LIBX264' + _def_x264_lavc='#define CONFIG_LIBX264 0' _nocodecmodules="x264 $_nocodecmodules" fi _res_comment="in libavcodec: $_x264_lavc" @@ -6999,7 +6999,7 @@ if test "$_libdirac_lavc" = yes ; then _libavdecoders="$_libavdecoders LIBDIRAC_DECODER" _codecmodules="libdirac $_codecmodules" else - _def_libdirac_lavc='#undef CONFIG_LIBDIRAC' + _def_libdirac_lavc='#define CONFIG_LIBDIRAC 0' _nocodecmodules="libdirac $_nocodecmodules" fi echores "$_libdirac_lavc" @@ -7031,7 +7031,7 @@ if test "$_libschroedinger_lavc" = yes ; then _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER" _codecmodules="libschroedinger $_codecmodules" else - _def_libschroedinger_lavc='#undef CONFIG_LIBSCHROEDINGER' + _def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0' _nocodecmodules="libschroedinger $_nocodecmodules" fi echores "$_libschroedinger_lavc" @@ -7122,7 +7122,7 @@ EOF else _mp3lame_lavc=no _def_mp3lame='#undef CONFIG_MP3LAME' - _def_mp3lame_lavc="#undef CONFIG_LIBMP3LAME" + _def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0" fi _res_comment="in libavcodec: $_mp3lame_lavc" echores "$_mp3lame" From c22d7e182cae67a762e35db1e224a305932989c3 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 13:07:38 +0000 Subject: [PATCH 28/58] Rename "ARM" section to "ARM Linux". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28431 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 1ae83a50bf..761297366d 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -61,8 +61,8 @@ from RPMFusion repository. - -ARM + +ARM Linux MPlayer works on Linux PDAs with ARM CPU e.g. Sharp From 1fdc384119c12f81d0f480f4c4e4d1fd360c7d83 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 13:11:23 +0000 Subject: [PATCH 29/58] Reminder for Dominik to update the RPM packaging section. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28432 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/ports.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DOCS/xml/en/ports.xml b/DOCS/xml/en/ports.xml index 761297366d..abf5c17f72 100644 --- a/DOCS/xml/en/ports.xml +++ b/DOCS/xml/en/ports.xml @@ -53,9 +53,10 @@ As root you can then install the .deb package as usual: RPM packaging -Dominik Mierzejewski maintains the official RPM packages of -MPlayer for Fedora and CentOS/RHEL. They are available -from RPMFusion repository. +To build an RPM package, run the following command in the +MPlayer source directory: + +FIXME: insert proper commands here From 85eac18b0a1746361201a967d0b91c1243b20b79 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 13:13:15 +0000 Subject: [PATCH 30/58] Add a few more #defines for FFmpeg to config.h. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28433 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index a0fb8a35ba..3d50fec210 100755 --- a/configure +++ b/configure @@ -8596,12 +8596,17 @@ $_def_threads $_def_yasm #define CONFIG_FASTDIV 0 +#define CONFIG_FFSERVER 0 #define CONFIG_GPL 1 +#define CONFIG_HARDCODED_TABLES 0 +#define CONFIG_POSIX_MEMALIGN 0 #define CONFIG_POWERPC_PERF 0 #define CONFIG_SMALL 0 #define CONFIG_SWSCALE 1 #define CONFIG_GRAY 0 +#define HAVE_POLL_H 1 + /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */ #define CONFIG_AANDCT 1 #define CONFIG_FFT 1 From be5f5c7046f896ca16d7b4656c192f64c6d2e226 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 13:16:46 +0000 Subject: [PATCH 31/58] Convert HAVE_CLOSESOCKET and HAVE_SOCKLEN_T into 0/1 definitions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28434 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 4 ++-- stream/network.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 3d50fec210..eebb69669f 100755 --- a/configure +++ b/configure @@ -2982,7 +2982,7 @@ done if test "$_socklen_t" = yes ; then _def_socklen_t='#define HAVE_SOCKLEN_T 1' else - _def_socklen_t='#undef HAVE_SOCKLEN_T' + _def_socklen_t='#define HAVE_SOCKLEN_T 0' fi echores "$_socklen_t" @@ -2997,7 +2997,7 @@ cc_check $_ld_sock && _closesocket=yes if test "$_closesocket" = yes ; then _def_closesocket='#define HAVE_CLOSESOCKET 1' else - _def_closesocket='#undef HAVE_CLOSESOCKET' + _def_closesocket='#define HAVE_CLOSESOCKET 0' fi echores "$_closesocket" diff --git a/stream/network.h b/stream/network.h index 36b470dfe4..5c41ddc70c 100644 --- a/stream/network.h +++ b/stream/network.h @@ -22,10 +22,10 @@ #include "url.h" #include "http.h" -#ifndef HAVE_CLOSESOCKET +#if !HAVE_CLOSESOCKET #define closesocket close #endif -#ifndef HAVE_SOCKLEN_T +#if !HAVE_SOCKLEN_T typedef int socklen_t; #endif From 3b222d68b0df4b3cc6d8271700703f495913b0ca Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 13:33:35 +0000 Subject: [PATCH 32/58] HAVE_ATON --> HAVE_INET_ATON to match FFmpeg and give it a 0/1 value. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28435 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 6 +++--- stream/librtsp/rtsp_rtp.c | 4 ++-- stream/tcp.c | 4 ++-- stream/udp.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configure b/configure index eebb69669f..900997e980 100755 --- a/configure +++ b/configure @@ -2964,9 +2964,9 @@ EOF echores "$_use_aton" fi -_def_use_aton='#undef HAVE_ATON' +_def_inet_aton='#define HAVE_INET_ATON 0' if test "$_use_aton" = yes; then - _def_use_aton='#define HAVE_ATON 1' + _def_inet_aton='#define HAVE_INET_ATON 1' fi @@ -8483,12 +8483,12 @@ $_def_fribidi $_def_closesocket $_def_ftp $_def_inet6 +$_def_inet_aton $_def_live $_def_nemesi $_def_network $_def_smb $_def_socklen_t -$_def_use_aton $_def_vstream diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c index b782b59cd5..7dc8f6d32c 100644 --- a/stream/librtsp/rtsp_rtp.c +++ b/stream/librtsp/rtsp_rtp.c @@ -298,7 +298,7 @@ rtp_connect (char *hostname, int port) sin.sin_addr.s_addr = htonl (INADDR_ANY); else #ifndef HAVE_WINSOCK2_H -#ifdef HAVE_ATON +#if HAVE_INET_ATON inet_aton (hostname, &sin.sin_addr); #else inet_pton (AF_INET, hostname, &sin.sin_addr); @@ -387,7 +387,7 @@ is_multicast_address (char *addr) sin.sin_family = AF_INET; #ifndef HAVE_WINSOCK2_H -#ifdef HAVE_ATON +#if HAVE_INET_ATON inet_aton (addr, &sin.sin_addr); #else inet_pton (AF_INET, addr, &sin.sin_addr); diff --git a/stream/tcp.c b/stream/tcp.c index 69072f80fa..a47280739a 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -116,7 +116,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { memset(&server_address, 0, sizeof(server_address)); #ifndef HAVE_WINSOCK2_H -#ifdef HAVE_ATON +#if HAVE_INET_ATON if (inet_aton(host, our_s_addr)!=1) #else if (inet_pton(af, host, our_s_addr)!=1) @@ -164,7 +164,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { return TCP_ERROR_FATAL; } -#if defined(HAVE_ATON) || defined(HAVE_WINSOCK2_H) +#if HAVE_INET_ATON || defined(HAVE_WINSOCK2_H) strncpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255); #else inet_ntop(af, our_s_addr, buf, 255); diff --git a/stream/udp.c b/stream/udp.c index e7ac97f597..86fdc1941d 100644 --- a/stream/udp.c +++ b/stream/udp.c @@ -92,11 +92,11 @@ udp_open_socket (URL_t *url) else { #ifndef HAVE_WINSOCK2_H -#ifdef HAVE_ATON +#if HAVE_INET_ATON inet_aton (url->hostname, &server_address.sin_addr); #else inet_pton (AF_INET, url->hostname, &server_address.sin_addr); -#endif /* HAVE_ATON */ +#endif /* HAVE_INET_ATON */ #else server_address.sin_addr.s_addr = htonl(INADDR_ANY); #endif /* HAVE_WINSOCK2_H */ From 12b79487739ffedd9a74940feebe9d4ef11079dc Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 13:40:15 +0000 Subject: [PATCH 33/58] Remove pointless #ifdef around internal header includes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28436 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/sub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libvo/sub.c b/libvo/sub.c index 94c38545dc..4bbc5813e3 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -8,16 +8,12 @@ #include #endif -#ifdef CONFIG_DVDNAV #include "stream/stream.h" #include "stream/stream_dvdnav.h" #define OSD_NAV_BOX_ALPHA 0x7f -#endif -#ifdef CONFIG_TV_TELETEXT #include "stream/tv.h" #include "osdep/timer.h" -#endif #include "mplayer.h" #include "mp_msg.h" From 0f65d3be9d874251c106d8bab3c43b0439ed5526 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 13:42:27 +0000 Subject: [PATCH 34/58] Convert HAVE_WINSOCK2_H into a 0/1 definition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28437 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- stream/asf_mmst_streaming.c | 2 +- stream/asf_streaming.c | 2 +- stream/http.c | 2 +- stream/librtsp/rtsp.c | 4 ++-- stream/librtsp/rtsp_rtp.c | 10 +++++----- stream/librtsp/rtsp_session.c | 2 +- stream/network.c | 2 +- stream/network.h | 2 +- stream/pnm.c | 4 ++-- stream/realrtsp/rmff.h | 2 +- stream/rtp.c | 2 +- stream/stream.c | 6 +++--- stream/stream_cddb.c | 2 +- stream/stream_ftp.c | 2 +- stream/stream_netstream.c | 6 +++--- stream/stream_netstream.h | 2 +- stream/stream_rtsp.c | 2 +- stream/tcp.c | 16 ++++++++-------- stream/udp.c | 10 +++++----- 20 files changed, 41 insertions(+), 41 deletions(-) diff --git a/configure b/configure index 900997e980..23e21109fc 100755 --- a/configure +++ b/configure @@ -2911,7 +2911,7 @@ if test $_winsock2_h = yes ; then _ld_sock="-lws2_32" def_winsock2_h='#define HAVE_WINSOCK2_H 1' else - def_winsock2_h='#undef HAVE_WINSOCK2_H' + def_winsock2_h='#define HAVE_WINSOCK2_H 0' fi diff --git a/stream/asf_mmst_streaming.c b/stream/asf_mmst_streaming.c index 36021af35c..c05ecb9240 100644 --- a/stream/asf_mmst_streaming.c +++ b/stream/asf_mmst_streaming.c @@ -39,7 +39,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c index a937c23432..64a8152ee3 100644 --- a/stream/asf_streaming.c +++ b/stream/asf_streaming.c @@ -9,7 +9,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif diff --git a/stream/http.c b/stream/http.c index 67b719269f..3286591943 100644 --- a/stream/http.c +++ b/stream/http.c @@ -11,7 +11,7 @@ #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #else #include #include diff --git a/stream/librtsp/rtsp.c b/stream/librtsp/rtsp.c index 19477fe5b3..8012174d99 100644 --- a/stream/librtsp/rtsp.c +++ b/stream/librtsp/rtsp.c @@ -42,7 +42,7 @@ #include #include #include -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #else #include @@ -72,7 +72,7 @@ static int write_stream(int s, const char *buf, int len) { if (n > 0) total += n; else if (n < 0) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if ((timeout>0) && ((errno == EAGAIN) || (errno == EINPROGRESS))) { #else if ((timeout>0) && ((errno == EAGAIN) || (WSAGetLastError() == WSAEINPROGRESS))) { diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c index 7dc8f6d32c..0d84480a6b 100644 --- a/stream/librtsp/rtsp_rtp.c +++ b/stream/librtsp/rtsp_rtp.c @@ -28,7 +28,7 @@ #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -251,7 +251,7 @@ rtcp_connect (int client_port, int server_port, const char* server_hostname) if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (errno != EINPROGRESS) #else if (WSAGetLastError() != WSAEINPROGRESS) @@ -297,7 +297,7 @@ rtp_connect (char *hostname, int port) if (!hostname || !strcmp (hostname, "0.0.0.0")) sin.sin_addr.s_addr = htonl (INADDR_ANY); else -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #if HAVE_INET_ATON inet_aton (hostname, &sin.sin_addr); #else @@ -332,7 +332,7 @@ rtp_connect (char *hostname, int port) /* datagram socket */ if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (errno != EINPROGRESS) #else if (WSAGetLastError() != WSAEINPROGRESS) @@ -386,7 +386,7 @@ is_multicast_address (char *addr) sin.sin_family = AF_INET; -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #if HAVE_INET_ATON inet_aton (addr, &sin.sin_addr); #else diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c index ce68dd765f..c196e5305d 100644 --- a/stream/librtsp/rtsp_session.c +++ b/stream/librtsp/rtsp_session.c @@ -30,7 +30,7 @@ #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff --git a/stream/network.c b/stream/network.c index 5cfe4a461e..19a87ea2a9 100644 --- a/stream/network.c +++ b/stream/network.c @@ -19,7 +19,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #include #endif diff --git a/stream/network.h b/stream/network.h index 5c41ddc70c..bc4ec598ef 100644 --- a/stream/network.h +++ b/stream/network.h @@ -12,7 +12,7 @@ #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff --git a/stream/pnm.c b/stream/pnm.c index 1ef86e620c..437ad8b0cb 100644 --- a/stream/pnm.c +++ b/stream/pnm.c @@ -35,7 +35,7 @@ #include #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include //#include //#include @@ -204,7 +204,7 @@ static int rm_write(int s, const char *buf, int len) { if (n > 0) total += n; else if (n < 0) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (timeout>0 && (errno == EAGAIN || errno == EINPROGRESS)) { #else if (timeout>0 && (errno == EAGAIN || WSAGetLastError() == WSAEINPROGRESS)) { diff --git a/stream/realrtsp/rmff.h b/stream/realrtsp/rmff.h index a58bb3ccdc..3699723f9b 100644 --- a/stream/realrtsp/rmff.h +++ b/stream/realrtsp/rmff.h @@ -31,7 +31,7 @@ #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff --git a/stream/rtp.c b/stream/rtp.c index 624812a0fe..cdfdc28f7b 100644 --- a/stream/rtp.c +++ b/stream/rtp.c @@ -13,7 +13,7 @@ #include #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff --git a/stream/stream.c b/stream/stream.c index bcf4836717..85b0a1f907 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -14,7 +14,7 @@ #include "config.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif @@ -408,7 +408,7 @@ stream_t* new_stream(int fd,int type){ if(s==NULL) return NULL; memset(s,0,sizeof(stream_t)); -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H { WSADATA wsdata; int temp = WSAStartup(0x0202, &wsdata); // there might be a better place for this (-> later) @@ -443,7 +443,7 @@ void free_stream(stream_t *s){ closesocket(s->fd); else close(s->fd); } -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H mp_msg(MSGT_STREAM,MSGL_V,"WINSOCK2 uninit\n"); WSACleanup(); // there might be a better place for this (-> later) #endif diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c index 4702f86d8c..55620a8b2d 100644 --- a/stream/stream_cddb.c +++ b/stream/stream_cddb.c @@ -27,7 +27,7 @@ #define mkdir(a,b) mkdir(a) #endif #include -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif #else diff --git a/stream/stream_ftp.c b/stream/stream_ftp.c index 95632e7375..bb833688aa 100644 --- a/stream/stream_ftp.c +++ b/stream/stream_ftp.c @@ -9,7 +9,7 @@ #include #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #else #include diff --git a/stream/stream_netstream.c b/stream/stream_netstream.c index 84e10a2c81..734c1f6412 100644 --- a/stream/stream_netstream.c +++ b/stream/stream_netstream.c @@ -42,7 +42,7 @@ #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -90,7 +90,7 @@ static const struct m_struct_st stream_opts = { //// When the cache is running we need a lock as //// fill_buffer is called from another proccess static int lock_fd(int fd) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H struct flock lock; memset(&lock,0,sizeof(struct flock)); @@ -113,7 +113,7 @@ printf("FIXME? should lock here\n"); } static int unlock_fd(int fd) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H struct flock lock; memset(&lock,0,sizeof(struct flock)); diff --git a/stream/stream_netstream.h b/stream/stream_netstream.h index 533e6a3b93..6ae46cabef 100644 --- a/stream/stream_netstream.h +++ b/stream/stream_netstream.h @@ -14,7 +14,7 @@ #include #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #endif #include "mp_msg.h" diff --git a/stream/stream_rtsp.c b/stream/stream_rtsp.c index c45f3aad86..591fc1765a 100644 --- a/stream/stream_rtsp.c +++ b/stream/stream_rtsp.c @@ -28,7 +28,7 @@ #include #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff --git a/stream/tcp.c b/stream/tcp.c index a47280739a..2cabc5e036 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -20,7 +20,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -75,7 +75,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { struct hostent *hp=NULL; char buf[255]; -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H unsigned long val; int to; #else @@ -91,7 +91,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { } #if defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO) -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H /* timeout in milliseconds */ to = 10 * 1000; #else @@ -115,7 +115,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { memset(&server_address, 0, sizeof(server_address)); -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #if HAVE_INET_ATON if (inet_aton(host, our_s_addr)!=1) #else @@ -139,7 +139,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { memcpy( our_s_addr, (void*)hp->h_addr_list[0], hp->h_length ); } -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H else { unsigned long addr = inet_addr(host); memcpy( our_s_addr, (void*)&addr, sizeof(addr) ); @@ -172,14 +172,14 @@ connect2Server_with_af(char *host, int port, int af,int verb) { if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ConnectingToServer, host, buf , port ); // Turn the socket as non blocking so we can timeout on the connection -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H fcntl( socket_server_fd, F_SETFL, fcntl(socket_server_fd, F_GETFL) | O_NONBLOCK ); #else val = 1; ioctlsocket( socket_server_fd, FIONBIO, &val ); #endif if( connect( socket_server_fd, (struct sockaddr*)&server_address, server_address_size )==-1 ) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if( errno!=EINPROGRESS ) { #else if( (WSAGetLastError() != WSAEINPROGRESS) && (WSAGetLastError() != WSAEWOULDBLOCK) ) { @@ -211,7 +211,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { if (ret < 0) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_SelectFailed); // Turn back the socket as blocking -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H fcntl( socket_server_fd, F_SETFL, fcntl(socket_server_fd, F_GETFL) & ~O_NONBLOCK ); #else val = 0; diff --git a/stream/udp.c b/stream/udp.c index 86fdc1941d..3731859655 100644 --- a/stream/udp.c +++ b/stream/udp.c @@ -31,7 +31,7 @@ #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -74,7 +74,7 @@ udp_open_socket (URL_t *url) if (isalpha (url->hostname[0])) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H hp = (struct hostent *) gethostbyname (url->hostname); if (!hp) { @@ -91,7 +91,7 @@ udp_open_socket (URL_t *url) } else { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #if HAVE_INET_ATON inet_aton (url->hostname, &server_address.sin_addr); #else @@ -110,7 +110,7 @@ udp_open_socket (URL_t *url) if (bind (socket_server_fd, (struct sockaddr *) &server_address, sizeof (server_address)) == -1) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (errno != EINPROGRESS) #else if (WSAGetLastError () != WSAEINPROGRESS) @@ -122,7 +122,7 @@ udp_open_socket (URL_t *url) } } -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H if (isalpha (url->hostname[0])) { hp = (struct hostent *) gethostbyname (url->hostname); From 0d86a0f652c5a131961d580e2704b1a74478fc7b Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 14:00:50 +0000 Subject: [PATCH 35/58] HAVE_DCBZL should be a 0/1 definition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28438 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 23e21109fc..bfcae67e88 100755 --- a/configure +++ b/configure @@ -2053,7 +2053,7 @@ EOF ppc|ppc64|powerpc|powerpc64) _arch='PPC' - _def_dcbzl='#undef HAVE_DCBZL' + _def_dcbzl='#define HAVE_DCBZL 0' _target_arch='ARCH_PPC = yes' _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='ppc' From 7e1662839a13794af3b0262b8cb99c0965acf072 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 14:38:28 +0000 Subject: [PATCH 36/58] Restructure network tests: Always check for both inet_aton and inet_pton. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28439 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 48 ++++++++++++++++----------------------- stream/librtsp/rtsp_rtp.c | 20 +++++++--------- stream/tcp.c | 10 ++++---- stream/udp.c | 12 ++++------ 4 files changed, 37 insertions(+), 53 deletions(-) diff --git a/configure b/configure index bfcae67e88..8bf0590b5f 100755 --- a/configure +++ b/configure @@ -2915,59 +2915,49 @@ else fi -_use_aton=no echocheck "inet_pton()" +def_inet_pton='#define HAVE_INET_PTON 0' +inet_pton=no cat > $TMPC << EOF #include #include #include int main(void) { (void) inet_pton(0, 0, 0); return 0; } EOF -if test "$_winsock2_h" = yes ; then - _res_comment="using winsock2 functions instead" - echores "no" -elif cc_check $_ld_sock ; then +if cc_check $_ld_sock ; then # NOTE: Linux has libresolv but does not need it - : test $_ld_sock && _res_comment="using $_ld_sock" - echores "yes" + inet_pton=yes + def_inet_pton='#define HAVE_INET_PTON 1' elif cc_check $_ld_sock -lresolv ; then - # NOTE: needed for SunOS at least _ld_sock="$_ld_sock -lresolv" _res_comment="using $_ld_sock" - echores "yes" -else - _res_comment="trying inet_aton next" - echores "no" + inet_pton=yes + def_inet_pton='#define HAVE_INET_PTON 1' +fi +echores "$inet_pton" echocheck "inet_aton()" +def_inet_aton='#define HAVE_INET_ATON 0' +inet_aton=no cat > $TMPC << EOF #include #include #include int main(void) { (void) inet_aton(0, 0); return 0; } EOF - _use_aton=yes if cc_check $_ld_sock ; then # NOTE: Linux has libresolv but does not need it - : test $_ld_sock && _res_comment="using $_ld_sock" + def_inet_aton='#define HAVE_INET_ATON 1' + inet_aton=yes elif cc_check $_ld_sock -lresolv ; then - # NOTE: needed for SunOS at least _ld_sock="$_ld_sock -lresolv" _res_comment="using $_ld_sock" - else - _use_aton=no - _network=no - _res_comment="network support disabled" + def_inet_aton='#define HAVE_INET_ATON 1' + inet_aton=yes fi - echores "$_use_aton" -fi - -_def_inet_aton='#define HAVE_INET_ATON 0' -if test "$_use_aton" = yes; then - _def_inet_aton='#define HAVE_INET_ATON 1' -fi +echores "$inet_aton" echocheck "socklen_t" @@ -3003,7 +2993,8 @@ echores "$_closesocket" echocheck "network" -# FIXME network check +test $_winsock2_h = no && test $inet_pton = no && + test $inet_aton = no && _network=no if test "$_network" = yes ; then _def_network='#define CONFIG_NETWORK 1' _ld_extra="$_ld_extra $_ld_sock" @@ -8483,7 +8474,8 @@ $_def_fribidi $_def_closesocket $_def_ftp $_def_inet6 -$_def_inet_aton +$def_inet_aton +$def_inet_pton $_def_live $_def_nemesi $_def_network diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c index 0d84480a6b..54a2180375 100644 --- a/stream/librtsp/rtsp_rtp.c +++ b/stream/librtsp/rtsp_rtp.c @@ -297,13 +297,11 @@ rtp_connect (char *hostname, int port) if (!hostname || !strcmp (hostname, "0.0.0.0")) sin.sin_addr.s_addr = htonl (INADDR_ANY); else -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - inet_aton (hostname, &sin.sin_addr); -#else +#if HAVE_INET_PTON inet_pton (AF_INET, hostname, &sin.sin_addr); -#endif -#else +#elif HAVE_INET_ATON + inet_aton (hostname, &sin.sin_addr); +#elif HAVE_WINSOCK2_H sin.sin_addr.s_addr = htonl (INADDR_ANY); #endif sin.sin_port = htons (port); @@ -386,13 +384,11 @@ is_multicast_address (char *addr) sin.sin_family = AF_INET; -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - inet_aton (addr, &sin.sin_addr); -#else +#if HAVE_INET_PTON inet_pton (AF_INET, addr, &sin.sin_addr); -#endif -#else +#elif HAVE_INET_ATON + inet_aton (addr, &sin.sin_addr); +#elif HAVE_WINSOCK2_H sin.sin_addr.s_addr = htonl (INADDR_ANY); #endif diff --git a/stream/tcp.c b/stream/tcp.c index 2cabc5e036..ac3165b1a7 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -115,13 +115,11 @@ connect2Server_with_af(char *host, int port, int af,int verb) { memset(&server_address, 0, sizeof(server_address)); -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - if (inet_aton(host, our_s_addr)!=1) -#else +#if HAVE_INET_PTON if (inet_pton(af, host, our_s_addr)!=1) -#endif -#else +#elif HAVE_INET_ATON + if (inet_aton(host, our_s_addr)!=1) +#elif HAVE_WINSOCK2_H if ( inet_addr(host)==INADDR_NONE ) #endif { diff --git a/stream/udp.c b/stream/udp.c index 3731859655..84769ce403 100644 --- a/stream/udp.c +++ b/stream/udp.c @@ -91,15 +91,13 @@ udp_open_socket (URL_t *url) } else { -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - inet_aton (url->hostname, &server_address.sin_addr); -#else +#if HAVE_INET_PTON inet_pton (AF_INET, url->hostname, &server_address.sin_addr); -#endif /* HAVE_INET_ATON */ -#else +#elif HAVE_INET_ATON + inet_aton (url->hostname, &server_address.sin_addr); +#elif !HAVE_WINSOCK2_H server_address.sin_addr.s_addr = htonl(INADDR_ANY); -#endif /* HAVE_WINSOCK2_H */ +#endif } server_address.sin_family = AF_INET; server_address.sin_port = htons (url->port); From 73608fa00b9366e30d947d6d301db0484acf936f Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 14:39:33 +0000 Subject: [PATCH 37/58] cosmetics: Fix indentation after last commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28440 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 8bf0590b5f..e8affec64a 100755 --- a/configure +++ b/configure @@ -2937,26 +2937,26 @@ elif cc_check $_ld_sock -lresolv ; then fi echores "$inet_pton" - echocheck "inet_aton()" +echocheck "inet_aton()" def_inet_aton='#define HAVE_INET_ATON 0' inet_aton=no - cat > $TMPC << EOF +cat > $TMPC << EOF #include #include #include int main(void) { (void) inet_aton(0, 0); return 0; } EOF - if cc_check $_ld_sock ; then - # NOTE: Linux has libresolv but does not need it - test $_ld_sock && _res_comment="using $_ld_sock" - def_inet_aton='#define HAVE_INET_ATON 1' - inet_aton=yes - elif cc_check $_ld_sock -lresolv ; then - _ld_sock="$_ld_sock -lresolv" - _res_comment="using $_ld_sock" - def_inet_aton='#define HAVE_INET_ATON 1' - inet_aton=yes - fi +if cc_check $_ld_sock ; then + # NOTE: Linux has libresolv but does not need it + test $_ld_sock && _res_comment="using $_ld_sock" + def_inet_aton='#define HAVE_INET_ATON 1' + inet_aton=yes +elif cc_check $_ld_sock -lresolv ; then + _ld_sock="$_ld_sock -lresolv" + _res_comment="using $_ld_sock" + def_inet_aton='#define HAVE_INET_ATON 1' + inet_aton=yes +fi echores "$inet_aton" From f6db24db92eab622b417464fd6c5924a9df62df1 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 14:42:57 +0000 Subject: [PATCH 38/58] Add some more definitions for FFmpeg to config.h. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28441 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index e8affec64a..2e3011e3fd 100755 --- a/configure +++ b/configure @@ -8597,7 +8597,10 @@ $_def_yasm #define CONFIG_SWSCALE 1 #define CONFIG_GRAY 0 +#define HAVE_ARPA_INET_H 1 +#define HAVE_DOS_PATHS 0 #define HAVE_POLL_H 1 +#define HAVE_PPC4XX 0 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */ #define CONFIG_AANDCT 1 From 820e400ba5bd31c97d7681a82e8389e7a4848f6d Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 14:57:01 +0000 Subject: [PATCH 39/58] Simplify inet_pton/inet_aton checks. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28442 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 2e3011e3fd..0cab35561f 100755 --- a/configure +++ b/configure @@ -2924,19 +2924,16 @@ cat > $TMPC << EOF #include int main(void) { (void) inet_pton(0, 0, 0); return 0; } EOF -if cc_check $_ld_sock ; then - # NOTE: Linux has libresolv but does not need it - test $_ld_sock && _res_comment="using $_ld_sock" - inet_pton=yes - def_inet_pton='#define HAVE_INET_PTON 1' -elif cc_check $_ld_sock -lresolv ; then - _ld_sock="$_ld_sock -lresolv" - _res_comment="using $_ld_sock" - inet_pton=yes +for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do + cc_check $_ld_tmp && inet_pton=yes && break +done +if test $inet_pton = yes ; then + test $_ld_tmp && _res_comment="using $_ld_tmp" def_inet_pton='#define HAVE_INET_PTON 1' fi echores "$inet_pton" + echocheck "inet_aton()" def_inet_aton='#define HAVE_INET_ATON 0' inet_aton=no @@ -2946,16 +2943,12 @@ cat > $TMPC << EOF #include int main(void) { (void) inet_aton(0, 0); return 0; } EOF -if cc_check $_ld_sock ; then - # NOTE: Linux has libresolv but does not need it - test $_ld_sock && _res_comment="using $_ld_sock" +for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do + cc_check $_ld_tmp && inet_aton=yes && break +done +if test $inet_aton = yes ; then + test $_ld_tmp && _res_comment="using $_ld_tmp" def_inet_aton='#define HAVE_INET_ATON 1' - inet_aton=yes -elif cc_check $_ld_sock -lresolv ; then - _ld_sock="$_ld_sock -lresolv" - _res_comment="using $_ld_sock" - def_inet_aton='#define HAVE_INET_ATON 1' - inet_aton=yes fi echores "$inet_aton" From b598021ed9d9f6f71a410af2babf2e88b7a32a2d Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 15:15:07 +0000 Subject: [PATCH 40/58] HAVE_WINSOCK2_H is now a 0/1 definition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28443 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/netstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TOOLS/netstream.c b/TOOLS/netstream.c index 8bc09b9a9d..300b1d3f80 100644 --- a/TOOLS/netstream.c +++ b/TOOLS/netstream.c @@ -28,7 +28,7 @@ #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include From 71e641a4c3ca0291c8a6ce37357687df55c42fdb Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 15:51:48 +0000 Subject: [PATCH 41/58] cosmetics: Remove period after copyright statement non-sentence. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28444 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/yuv2rgb_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/yuv2rgb_template.c b/libswscale/yuv2rgb_template.c index a850545a48..216ddd2803 100644 --- a/libswscale/yuv2rgb_template.c +++ b/libswscale/yuv2rgb_template.c @@ -1,7 +1,7 @@ /* * yuv2rgb_mmx.c, software YUV to RGB converter with Intel MMX "technology" * - * Copyright (C) 2000, Silicon Integrated System Corp. + * Copyright (C) 2000, Silicon Integrated System Corp * * Author: Olie Lho * From 043159f3bbaf261971cd09fc52d8f675c5464bc9 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 1 Feb 2009 16:02:19 +0000 Subject: [PATCH 42/58] Do not print a warning if current pts is equal to previous pts. patch by Dennis Vshivkov, jaimor orcon net nz git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28445 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mplayer.c b/mplayer.c index a6c57c0c40..998e2226e1 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2307,9 +2307,9 @@ static double update_video(int *blit_frame) } if (sh_video->last_pts == MP_NOPTS_VALUE) sh_video->last_pts= sh_video->pts; - else if (sh_video->last_pts >= sh_video->pts) { + else if (sh_video->last_pts > sh_video->pts) { sh_video->last_pts = sh_video->pts; - mp_msg(MSGT_CPLAYER, MSGL_INFO, "pts value <= previous\n"); + mp_msg(MSGT_CPLAYER, MSGL_INFO, "pts value < previous\n"); } frame_time = sh_video->pts - sh_video->last_pts; sh_video->last_pts = sh_video->pts; From 4557c10cb023958b47f6c17b9d080f740eb7ec62 Mon Sep 17 00:00:00 2001 From: rathann Date: Sun, 1 Feb 2009 23:40:26 +0000 Subject: [PATCH 43/58] Chinese manpage is actually simplified Chinese (zh_CN), so rename the manpage directory to reflect that. Also update configure to handle two-part lang codes for manpages. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28446 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/{zh => zh_CN}/mplayer.1 | 0 configure | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename DOCS/man/{zh => zh_CN}/mplayer.1 (100%) diff --git a/DOCS/man/zh/mplayer.1 b/DOCS/man/zh_CN/mplayer.1 similarity index 100% rename from DOCS/man/zh/mplayer.1 rename to DOCS/man/zh_CN/mplayer.1 diff --git a/configure b/configure index 0cab35561f..b56575d7b7 100755 --- a/configure +++ b/configure @@ -197,7 +197,7 @@ case `echo -n` in esac msg_lang_all=`echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g"` -man_lang_all=`echo DOCS/man/??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g"` +man_lang_all=`echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g"` doc_lang_all=`echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g"` show_help(){ From edc3c57aeef30663e4d25ca1d0e291d8be73b31c Mon Sep 17 00:00:00 2001 From: zuxy Date: Mon, 2 Feb 2009 07:26:05 +0000 Subject: [PATCH 44/58] Convert CONFIG_XVMC into a 0/1 definition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28447 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index c59e9f1b8b..dc9ce071d1 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -26,7 +26,7 @@ LIBVD_EXTERN(ffmpeg) #include "libavcodec/avcodec.h" -#ifdef CONFIG_XVMC +#if CONFIG_XVMC #include "xvmc_render.h" #endif @@ -59,7 +59,7 @@ typedef struct { static int get_buffer(AVCodecContext *avctx, AVFrame *pic); static void release_buffer(AVCodecContext *avctx, AVFrame *pic); -#ifdef CONFIG_XVMC +#if CONFIG_XVMC static enum PixelFormat get_format(struct AVCodecContext * avctx, const enum PixelFormat * pix_fmt); static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic); @@ -143,7 +143,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ if(avctx->pix_fmt==PIX_FMT_YUV420P) return CONTROL_TRUE;// u/v swap if(avctx->pix_fmt==PIX_FMT_YUV422P && !ctx->do_dr1) return CONTROL_TRUE;// half stride break; -#ifdef CONFIG_XVMC +#if CONFIG_XVMC case IMGFMT_XVMC_IDCT_MPEG2: case IMGFMT_XVMC_MOCO_MPEG2: if(avctx->pix_fmt==PIX_FMT_XVMC_MPEG2_IDCT) return CONTROL_TRUE; @@ -250,7 +250,7 @@ static int init(sh_video_t *sh){ ctx->avctx = avcodec_alloc_context(); avctx = ctx->avctx; -#ifdef CONFIG_XVMC +#if CONFIG_XVMC #ifdef CODEC_CAP_HWACCEL if(lavc_codec->capabilities & CODEC_CAP_HWACCEL){ @@ -533,7 +533,7 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt){ case PIX_FMT_RGB565: ctx->best_csp=IMGFMT_BGR16;break; //4xm case PIX_FMT_GRAY8: ctx->best_csp=IMGFMT_Y800;break; // gray jpeg case PIX_FMT_PAL8: ctx->best_csp=IMGFMT_BGR8;break; //8bps,mrle,cram -#ifdef CONFIG_XVMC +#if CONFIG_XVMC case PIX_FMT_XVMC_MPEG2_MC:ctx->best_csp=IMGFMT_XVMC_MOCO_MPEG2;break; case PIX_FMT_XVMC_MPEG2_IDCT:ctx->best_csp=IMGFMT_XVMC_IDCT_MPEG2;break; #endif @@ -910,7 +910,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ return mpi; } -#ifdef CONFIG_XVMC +#if CONFIG_XVMC static enum PixelFormat get_format(struct AVCodecContext * avctx, const enum PixelFormat * fmt){ sh_video_t * sh = avctx->opaque; From 75243478ce90d862f64c8fa6a03d0a651099317b Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 2 Feb 2009 20:22:36 +0000 Subject: [PATCH 45/58] Adapt to lzo changes in libavutil git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28448 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_lzo.c | 4 ++-- libmpdemux/demux_mkv.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libmpcodecs/vd_lzo.c b/libmpcodecs/vd_lzo.c index a2e92a5301..5371e4115f 100644 --- a/libmpcodecs/vd_lzo.c +++ b/libmpcodecs/vd_lzo.c @@ -55,7 +55,7 @@ static int init(sh_video_t *sh) return 0; } priv->bufsz = sh->bih->biSizeImage; - priv->buffer = malloc(priv->bufsz + LZO_OUTPUT_PADDING); + priv->buffer = malloc(priv->bufsz + AV_LZO_OUTPUT_PADDING); priv->codec = -1; sh->context = priv; @@ -88,7 +88,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags) return NULL; // skipped frame } - r = lzo1x_decode(priv->buffer, &w, data, &len); + r = av_lzo1x_decode(priv->buffer, &w, data, &len); if (r) { /* this should NEVER happen */ mp_msg (MSGT_DECVIDEO, MSGL_ERR, diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index b63f466e86..8c04a5132d 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -351,12 +351,12 @@ demux_mkv_decode (mkv_track_t *track, uint8_t *src, uint8_t **dest, while (1) { int srclen = *size; - if (dstlen > SIZE_MAX - LZO_OUTPUT_PADDING) goto lzo_fail; - *dest = realloc (*dest, dstlen + LZO_OUTPUT_PADDING); - result = lzo1x_decode (*dest, &dstlen, src, &srclen); + if (dstlen > SIZE_MAX - AV_LZO_OUTPUT_PADDING) goto lzo_fail; + *dest = realloc (*dest, dstlen + AV_LZO_OUTPUT_PADDING); + result = av_lzo1x_decode (*dest, &dstlen, src, &srclen); if (result == 0) break; - if (!(result & LZO_OUTPUT_FULL)) + if (!(result & AV_LZO_OUTPUT_FULL)) { lzo_fail: mp_msg (MSGT_DEMUX, MSGL_WARN, @@ -859,7 +859,7 @@ demux_mkv_read_trackentry (demuxer_t *demuxer) // audit: cheap guard against overflows later.. if (num > SIZE_MAX - 1000) return 0; l = x + num; - track->private_data = malloc (num + LZO_INPUT_PADDING); + track->private_data = malloc (num + AV_LZO_INPUT_PADDING); if (stream_read(s, track->private_data, num) != (int) num) goto err_out; track->private_size = num; @@ -2875,8 +2875,8 @@ demux_mkv_fill_buffer (demuxer_t *demuxer, demux_stream_t *ds) case MATROSKA_ID_BLOCK: block_length = ebml_read_length (s, &tmp); free(block); - if (block_length > SIZE_MAX - LZO_INPUT_PADDING) return 0; - block = malloc (block_length + LZO_INPUT_PADDING); + if (block_length > SIZE_MAX - AV_LZO_INPUT_PADDING) return 0; + block = malloc (block_length + AV_LZO_INPUT_PADDING); demuxer->filepos = stream_tell (s); if (stream_read (s,block,block_length) != (int) block_length) { From 046cf63aff27747e4b62e4a260895023d60be68f Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 2 Feb 2009 23:48:16 +0000 Subject: [PATCH 46/58] FFmpeg sync: LZO_OUTPUT_PADDING --> AV_LZO_OUTPUT_PADDING git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28449 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/nuppelvideo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpcodecs/native/nuppelvideo.c b/libmpcodecs/native/nuppelvideo.c index ff3e1f83fa..c0b3b8ac11 100644 --- a/libmpcodecs/native/nuppelvideo.c +++ b/libmpcodecs/native/nuppelvideo.c @@ -56,7 +56,7 @@ void decode_nuv( unsigned char *encoded, int encoded_size, int in_len = encodedh->packetlength; #ifdef KEEP_BUFFER if (!previous_buffer) - previous_buffer = ( unsigned char * ) malloc ( out_len + LZO_OUTPUT_PADDING ); + previous_buffer = ( unsigned char * ) malloc ( out_len + AV_LZO_OUTPUT_PADDING ); #endif switch(encodedh->comptype) @@ -69,7 +69,7 @@ void decode_nuv( unsigned char *encoded, int encoded_size, break; case '2': /* RTJpeg with LZO */ if (!buffer) - buffer = ( unsigned char * ) malloc ( out_len + LZO_OUTPUT_PADDING ); + buffer = ( unsigned char * ) malloc ( out_len + AV_LZO_OUTPUT_PADDING ); if (!buffer) { mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n"); From a019ba3643001e90a53d31d05129ad43e4fd6f15 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 00:12:19 +0000 Subject: [PATCH 47/58] Rename lzo1x_decode -> av_lzo1x_decode, this was missed in the previous patch. It currently works (though badly with missing prototype) but will break on libavutil version bump. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28450 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/nuppelvideo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpcodecs/native/nuppelvideo.c b/libmpcodecs/native/nuppelvideo.c index c0b3b8ac11..8128f85c47 100644 --- a/libmpcodecs/native/nuppelvideo.c +++ b/libmpcodecs/native/nuppelvideo.c @@ -75,7 +75,7 @@ void decode_nuv( unsigned char *encoded, int encoded_size, mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n"); break; } - r = lzo1x_decode ( buffer, &out_len, encoded + 12, &in_len ); + r = av_lzo1x_decode ( buffer, &out_len, encoded + 12, &in_len ); if ( r ) { mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n"); @@ -84,7 +84,7 @@ void decode_nuv( unsigned char *encoded, int encoded_size, RTjpeg_decompressYUV420 ( ( __s8 * ) buffer, decoded ); break; case '3': /* raw YUV420 with LZO */ - r = lzo1x_decode ( decoded, &out_len, encoded + 12, &in_len ); + r = av_lzo1x_decode ( decoded, &out_len, encoded + 12, &in_len ); if ( r ) { mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n"); From ad8c8f6f28eda527dba28b57496fa5284d68cab1 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 10:14:44 +0000 Subject: [PATCH 48/58] Fix several return values git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28451 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_direct3d.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index e212b966fd..64b84e01a6 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -437,7 +437,7 @@ static int configure_d3d(void) if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device, &vp))) { mp_msg(MSGT_VO, MSGL_ERR, "Unable to set the viewport\n"); - return VO_ERROR; + return 0; } calc_fs_rect(); @@ -468,7 +468,7 @@ static int reconfigure_d3d(void) priv->d3d_handle = Direct3DCreate9(D3D_SDK_VERSION); if (!priv->d3d_handle) { mp_msg(MSGT_VO, MSGL_ERR, "Unable to initialize Direct3D\n"); - return -1; + return 0; } /* Configure Direct3D */ @@ -519,7 +519,7 @@ static int resize_d3d(void) if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device, &vp))) { mp_msg(MSGT_VO, MSGL_ERR, "Unable to set the viewport\n"); - return VO_ERROR; + return 0; } calc_fs_rect(); From af87ab3afdc2613ed6317f1eb534ff2cf878fce3 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 10:16:03 +0000 Subject: [PATCH 49/58] Check for change_d3d_backbuffer failure. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28452 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_direct3d.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index 64b84e01a6..ede069ee77 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -492,7 +492,8 @@ static int resize_d3d(void) if (vo_dwidth > priv->cur_backbuf_width || vo_dheight > priv->cur_backbuf_height) { - change_d3d_backbuffer (BACKBUFFER_RESET); + if (!change_d3d_backbuffer(BACKBUFFER_RESET)) + return 0; } /* Destroy the OSD textures. They should always match the new dimensions From fbac650de32903d6abafbb4dbc0cff445c8478f1 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 10:17:14 +0000 Subject: [PATCH 50/58] Whitespace/comment typo cosmetics. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28453 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_direct3d.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index ede069ee77..292aec76f0 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -56,7 +56,7 @@ static struct global_priv { 0 = Movie is not paused */ int is_clear_needed; /**< 1 = Clear the backbuffer before StretchRect 0 = (default) Don't clear it */ - D3DLOCKED_RECT locked_rect; /**< The locked Offscreen surface */ + D3DLOCKED_RECT locked_rect; /**< The locked offscreen surface */ RECT fs_movie_rect; /**< Rect (upscaled) of the movie when displayed in fullscreen */ RECT fs_panscan_rect; /**< PanScan source surface cropping in @@ -273,10 +273,10 @@ static int create_d3d_surfaces(void) // make sure we respect the size limits without breaking aspect or pow2-requirements while (tex_width > priv->max_texture_width || tex_height > priv->max_texture_height) { - osd_width >>= 1; - osd_height >>= 1; - tex_width >>= 1; - tex_height >>= 1; + osd_width >>= 1; + osd_height >>= 1; + tex_width >>= 1; + tex_height >>= 1; } priv->osd_width = osd_width; From 680eb1a1e4f1c3c35eabc0bc7375e70deb658b63 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 10:21:17 +0000 Subject: [PATCH 51/58] Cosmetics: remove empty line, improve some messages. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28454 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_direct3d.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index 292aec76f0..abeba43ada 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -860,19 +860,17 @@ static void flip_page(void) RECT rect = {0, 0, vo_dwidth, vo_dheight}; if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) { mp_msg(MSGT_VO, MSGL_V, - "Video adapter became uncooperative.\n"); - mp_msg(MSGT_VO, MSGL_ERR, "Trying to reinitialize it...\n"); + "Trying to reinitialize uncooperative video adapter.\n"); if (!reconfigure_d3d()) { - mp_msg(MSGT_VO, MSGL_V, "Reinitialization Failed.\n"); + mp_msg(MSGT_VO, MSGL_V, "Reinitialization failed.\n"); return; } if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) { - mp_msg(MSGT_VO, MSGL_V, "Reinitialization Failed.\n"); + mp_msg(MSGT_VO, MSGL_V, "Reinitialization failed.\n"); return; } else mp_msg(MSGT_VO, MSGL_V, "Video adapter reinitialized.\n"); - } } From 3819692fdad07d6b9bc16615bc9401fd76a367ee Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 10:39:56 +0000 Subject: [PATCH 52/58] swab() needs _XOPEN_SOURCE to be defined. Fixes two implicit declaration warnings. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28455 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 + libmpcodecs/ad_hwac3.c | 1 + libmpcodecs/ad_liba52.c | 1 + 3 files changed, 3 insertions(+) diff --git a/configure b/configure index b56575d7b7..78347b1dad 100755 --- a/configure +++ b/configure @@ -3564,6 +3564,7 @@ echores "$_vsscanf" echocheck "swab()" cat > $TMPC << EOF +#define _XOPEN_SOURCE #include int main(void) { swab(0, 0, 0); return 0; } EOF diff --git a/libmpcodecs/ad_hwac3.c b/libmpcodecs/ad_hwac3.c index 1757018796..d58de77610 100644 --- a/libmpcodecs/ad_hwac3.c +++ b/libmpcodecs/ad_hwac3.c @@ -5,6 +5,7 @@ (see http://www.dtek.chalmers.se/~dvd/) */ +#define _XOPEN_SOURCE #include #include #include diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c index d886ad6a6a..73b43dcaab 100644 --- a/libmpcodecs/ad_liba52.c +++ b/libmpcodecs/ad_liba52.c @@ -1,3 +1,4 @@ +#define _XOPEN_SOURCE #include #include #include From cd8ef8a8f609e99d0225a27ceb84afa8cfe5d962 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 10:54:27 +0000 Subject: [PATCH 53/58] Remove the Present call after adapter reinitialization, it can not work anyway since no video frame is uploaded to the new context yet. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28456 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_direct3d.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index abeba43ada..2f4847ee10 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -865,10 +865,6 @@ static void flip_page(void) mp_msg(MSGT_VO, MSGL_V, "Reinitialization failed.\n"); return; } - if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) { - mp_msg(MSGT_VO, MSGL_V, "Reinitialization failed.\n"); - return; - } else mp_msg(MSGT_VO, MSGL_V, "Video adapter reinitialized.\n"); } From 0fcb10126775c40a9cba9c2cb43cd57ef13bbaa6 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 11:00:09 +0000 Subject: [PATCH 54/58] Add checks that a D3D device is available before attempting rendering. We may have lost the device e.g. because it became uncooperative e.g. when using remote desktop or Vista's UAC is activated. Patch by Georgi Petrov [gogothebee gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28457 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_direct3d.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index 2f4847ee10..b9ad1002ad 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -566,6 +566,11 @@ static uint32_t render_d3d_frame(mp_image_t *mpi) * if (mpi->flags & MP_IMGFLAG_DIRECT) ... */ + /* If the D3D device is uncooperative (not initialized), return success. + The device will be probed for reinitialization in the next flip_page() */ + if (!priv->d3d_device) + return VO_TRUE; + if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK) goto skip_upload; @@ -858,7 +863,8 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, static void flip_page(void) { RECT rect = {0, 0, vo_dwidth, vo_dheight}; - if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) { + if (!priv->d3d_device || + FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) { mp_msg(MSGT_VO, MSGL_V, "Trying to reinitialize uncooperative video adapter.\n"); if (!reconfigure_d3d()) { @@ -909,6 +915,11 @@ static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y ) char *dst; /**< Pointer to the destination image */ int uv_stride; /**< Stride of the U/V planes */ + /* If the D3D device is uncooperative (not initialized), return success. + The device will be probed for reinitialization in the next flip_page() */ + if (!priv->d3d_device) + return 0; + /* Lock the offscreen surface if it's not already locked. */ if (!priv->locked_rect.pBits) { if (FAILED(IDirect3DSurface9_LockRect(priv->d3d_surface, @@ -1017,6 +1028,10 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, */ static void draw_osd(void) { + // we can not render OSD if we lost the device e.g. because it was uncooperative + if (!priv->d3d_device) + return; + if (vo_osd_changed(0)) { D3DLOCKED_RECT locked_rect; /**< Offscreen surface we lock in order to copy MPlayer's frame inside it.*/ From 9b8170ca5453ab008f08a1b6c6a08ae61c9283d5 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 11:46:31 +0000 Subject: [PATCH 55/58] Latest 9.1 ATI drivers finally fixed PBOs, thus do not need ati-hack and are much faster without it. Change autodetection accordingly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28458 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 30402233af..a692d1573d 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -404,13 +404,22 @@ static void uninitGl(void) { static void autodetectGlExtensions(void) { const char *extensions = glGetString(GL_EXTENSIONS); const char *vendor = glGetString(GL_VENDOR); + const char *version = glGetString(GL_VERSION); int is_ati = strstr(vendor, "ATI") != NULL; - if (ati_hack == -1) ati_hack = is_ati; + int ati_broken_pbo = 0; + if (is_ati && strncmp(version, "2.1.", 4) == 0) { + int ver = atoi(version + 4); + mp_msg(MSGT_VO, MSGL_V, "[gl] Detected ATI driver version: %i\n", ver); + ati_broken_pbo = ver && ver < 8395; + } + if (ati_hack == -1) ati_hack = ati_broken_pbo; if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0; if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 0 : 0; if (is_ati && (lscale == 1 || lscale == 2 || cscale == 1 || cscale == 2)) mp_msg(MSGT_VO, MSGL_WARN, "Selected scaling mode may be broken on ATI cards.\n" "Tell _them_ to fix GL_REPEAT if you have issues.\n"); + mp_msg(MSGT_VO, MSGL_V, "[gl] Settings after autodetection: ati-hack = %i, force-pbo = %i, rectangle = %i\n", + ati_hack, force_pbo, use_rectangle); } /** From 406a602ecc8d73f4cc1125092eee285743ad4a61 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 11:47:07 +0000 Subject: [PATCH 56/58] Add [gl] in front of vo_gl message git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28459 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index a692d1573d..334b724e07 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -416,7 +416,7 @@ static void autodetectGlExtensions(void) { if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0; if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 0 : 0; if (is_ati && (lscale == 1 || lscale == 2 || cscale == 1 || cscale == 2)) - mp_msg(MSGT_VO, MSGL_WARN, "Selected scaling mode may be broken on ATI cards.\n" + mp_msg(MSGT_VO, MSGL_WARN, "[gl] Selected scaling mode may be broken on ATI cards.\n" "Tell _them_ to fix GL_REPEAT if you have issues.\n"); mp_msg(MSGT_VO, MSGL_V, "[gl] Settings after autodetection: ati-hack = %i, force-pbo = %i, rectangle = %i\n", ati_hack, force_pbo, use_rectangle); From 25f5652082dcae51b12af17ee092fe370c25a15d Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Feb 2009 12:17:49 +0000 Subject: [PATCH 57/58] Hack: fix MINGW compilation by hard-coding HAVE_ARPA_INET_H to 0 if __MINGW32__ is defined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28460 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index 78347b1dad..461cda1a51 100755 --- a/configure +++ b/configure @@ -8591,7 +8591,11 @@ $_def_yasm #define CONFIG_SWSCALE 1 #define CONFIG_GRAY 0 +#ifdef __MINGW32__ +#define HAVE_ARPA_INET_H 0 +#else #define HAVE_ARPA_INET_H 1 +#endif #define HAVE_DOS_PATHS 0 #define HAVE_POLL_H 1 #define HAVE_PPC4XX 0 From 09bf506c34a73d587c999ce161a0714159e1e5b6 Mon Sep 17 00:00:00 2001 From: compn Date: Tue, 3 Feb 2009 12:20:18 +0000 Subject: [PATCH 58/58] add automatic hw acceleration for vo gl entry git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28461 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index a64264234a..263026c41c 100644 --- a/Changelog +++ b/Changelog @@ -97,6 +97,7 @@ MPlayer (1.0) * Direct3D Windows video output driver added. * factorize code in vo_wii * removed unnecessary code from vo x11, xv, xvmc + * automatic detection of hw acceleration (vo gl:yuv=x) for vo_gl MEncoder: * check for system-wide configuration file in MEncoder