From f3928b94642cc46805513cf76c9e3f4c3a1102a7 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 17 Mar 2010 13:20:06 +0000 Subject: Split subarch handling off from generic arch handling. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30919 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 2b606861e0..67545f2df2 100755 --- a/configure +++ b/configure @@ -1765,10 +1765,12 @@ def_fast_64bit='#define HAVE_FAST_64BIT 0' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0' def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 0' def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 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 SGI_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' + arch='X86' + subarch='X86_32' libavcodec_arch="x86" target_arch="ARCH_X86 = yes" target_subarch="ARCH_X86_32 = yes" @@ -2017,7 +2019,8 @@ EOF ;; x86_64|amd64) - arch='X86 X86_64' + arch='X86' + subarch='X86_64' libavcodec_arch="x86" target_subarch='ARCH_X86_64 = yes' target_arch="ARCH_X86 = yes" @@ -2175,7 +2178,7 @@ EOF iproc='ppc' if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then - arch='PPC PPC64' + subarch='PPC64' target_subarch='ARCH_PPC64 = yes' def_fast_64bit='#define HAVE_FAST_64BIT 1' fi @@ -8918,6 +8921,7 @@ $def_pthread_cache $def_words_endian $def_bigendian $(ff_config_enable "$arch_all" "$arch" "ARCH") +$(ff_config_enable "$subarch_all" "$subarch" "ARCH") $(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE") -- cgit v1.2.3 From dc440b47d36169ad9e89a360922eca211be23ec3 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 17 Mar 2010 13:34:33 +0000 Subject: Make ff_config_enable work with lowercase values. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30920 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 67545f2df2..93576601fc 100755 --- a/configure +++ b/configure @@ -8766,10 +8766,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" -- cgit v1.2.3 From 0be7b19c27b9171956f3b81d1c8cfa5369d1154c Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 17 Mar 2010 13:37:36 +0000 Subject: cosmetics: Drop leading underscore from cpuexts variables. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30921 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/configure b/configure index 93576601fc..bb02b1555e 100755 --- a/configure +++ b/configure @@ -2845,27 +2845,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 @@ -8503,7 +8503,7 @@ EXESUFS_ALL = .exe $target_arch ARCH = $libavcodec_arch $target_subarch -$(echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/') +$(echo $cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/') MENCODER = $_mencoder MPLAYER = $_mplayer @@ -8924,7 +8924,7 @@ $def_words_endian $def_bigendian $(ff_config_enable "$arch_all" "$arch" "ARCH") $(ff_config_enable "$subarch_all" "$subarch" "ARCH") -$(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE") +$(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE") /* DVD/VCD/CD */ -- cgit v1.2.3 From c52aed20ee4bb3fc05fbec39dc3daf8959dcdc3c Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 17 Mar 2010 13:41:54 +0000 Subject: Lowercase arch and subarch values. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30922 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/configure b/configure index bb02b1555e..2178e78449 100755 --- a/configure +++ b/configure @@ -1769,8 +1769,8 @@ arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS SGI_MIPS PA_RISC S390 S390 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' - subarch='X86_32' + arch='x86' + subarch='x86_32' libavcodec_arch="x86" target_arch="ARCH_X86 = yes" target_subarch="ARCH_X86_32 = yes" @@ -2012,15 +2012,15 @@ EOF ;; ia64) - arch='IA64' + arch='ia64' target_arch='ARCH_IA64 = yes' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='ia64' ;; x86_64|amd64) - arch='X86' - subarch='X86_64' + arch='x86' + subarch='x86_64' libavcodec_arch="x86" target_subarch='ARCH_X86_64 = yes' target_arch="ARCH_X86 = yes" @@ -2116,7 +2116,7 @@ EOF ;; sparc|sparc64) - arch='SPARC' + arch='sparc' libavcodec_arch="sparc" target_arch='ARCH_SPARC = yes' iproc='sparc' @@ -2145,14 +2145,14 @@ EOF ;; arm*) - arch='ARM' + arch='arm' libavcodec_arch="arm" target_arch='ARCH_ARM = yes' iproc='arm' ;; avr32) - arch='AVR32' + arch='avr32' libavcodec_arch="avr32" target_arch='ARCH_AVR32 = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' @@ -2161,14 +2161,14 @@ EOF ;; sh|sh4) - arch='SH4' + arch='sh4' libavcodec_arch="sh4" target_arch='ARCH_SH4 = yes' iproc='sh4' ;; ppc|ppc64|powerpc|powerpc64) - arch='PPC' + arch='ppc' def_dcbzl='#define HAVE_DCBZL 0' libavcodec_arch="ppc" target_arch='ARCH_PPC = yes' @@ -2178,7 +2178,7 @@ EOF iproc='ppc' if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then - subarch='PPC64' + subarch='ppc64' target_subarch='ARCH_PPC64 = yes' def_fast_64bit='#define HAVE_FAST_64BIT 1' fi @@ -2287,7 +2287,7 @@ EOF ;; alpha*) - arch='ALPHA' + arch='alpha' libavcodec_arch="alpha" target_arch='ARCH_ALPHA = yes' iproc='alpha' @@ -2331,7 +2331,7 @@ EOF ;; mips) - arch='SGI_MIPS' + arch='sgi_mips' libavcodec_arch="mips" target_arch='ARCH_SGI_MIPS = yes' iproc='sgi-mips' @@ -2359,37 +2359,37 @@ EOF ;; hppa) - arch='PA_RISC' + arch='pa_risc' target_arch='ARCH_PA_RISC = yes' iproc='PA-RISC' ;; s390) - arch='S390' + arch='s390' target_arch='ARCH_S390 = yes' iproc='390' ;; s390x) - arch='S390X' + arch='s390x' target_arch='ARCH_S390X = yes' iproc='390x' ;; vax) - arch='VAX' + arch='vax' target_arch='ARCH_VAX = yes' iproc='vax' ;; xtensa) - arch='XTENSA' + arch='xtensa' target_arch='ARCH_XTENSA = yes' iproc='xtensa' ;; generic) - arch='GENERIC' + arch='generic' target_arch='ARCH_GENERIC = yes' ;; -- cgit v1.2.3 From 82b8a649aee9a1ea35236cdeb44074d434716ced Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 17 Mar 2010 13:55:59 +0000 Subject: Drop libavcodec_arch hack; ARCH can now be set directly in config.mak. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30923 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/configure b/configure index 2178e78449..4e44602933 100755 --- a/configure +++ b/configure @@ -1771,7 +1771,6 @@ case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) arch='x86' subarch='x86_32' - libavcodec_arch="x86" target_arch="ARCH_X86 = yes" target_subarch="ARCH_X86_32 = yes" def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' @@ -2021,7 +2020,6 @@ EOF x86_64|amd64) arch='x86' subarch='x86_64' - libavcodec_arch="x86" target_subarch='ARCH_X86_64 = yes' target_arch="ARCH_X86 = yes" def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' @@ -2117,7 +2115,6 @@ EOF sparc|sparc64) arch='sparc' - libavcodec_arch="sparc" target_arch='ARCH_SPARC = yes' iproc='sparc' if test "$host_arch" = "sparc64" ; then @@ -2146,14 +2143,12 @@ EOF arm*) arch='arm' - libavcodec_arch="arm" target_arch='ARCH_ARM = yes' iproc='arm' ;; avr32) arch='avr32' - libavcodec_arch="avr32" target_arch='ARCH_AVR32 = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='avr32' @@ -2162,7 +2157,6 @@ EOF sh|sh4) arch='sh4' - libavcodec_arch="sh4" target_arch='ARCH_SH4 = yes' iproc='sh4' ;; @@ -2170,7 +2164,6 @@ EOF ppc|ppc64|powerpc|powerpc64) arch='ppc' def_dcbzl='#define HAVE_DCBZL 0' - libavcodec_arch="ppc" target_arch='ARCH_PPC = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1' @@ -2288,7 +2281,6 @@ EOF alpha*) arch='alpha' - libavcodec_arch="alpha" target_arch='ARCH_ALPHA = yes' iproc='alpha' @@ -2332,7 +2324,6 @@ EOF mips) arch='sgi_mips' - libavcodec_arch="mips" target_arch='ARCH_SGI_MIPS = yes' iproc='sgi-mips' @@ -8500,8 +8491,8 @@ TIMER = $_timer EXESUF = $_exesuf EXESUFS_ALL = .exe +ARCH = $arch $target_arch -ARCH = $libavcodec_arch $target_subarch $(echo $cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/') -- cgit v1.2.3 From d32a13a467e319ce7503f1cbeeeb27b09483556b Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 17 Mar 2010 14:09:09 +0000 Subject: Rename SGI_MIPS architecture to plain MIPS. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30924 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 8 ++++---- cpudetect.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 4e44602933..9787014c25 100755 --- a/configure +++ b/configure @@ -1765,7 +1765,7 @@ def_fast_64bit='#define HAVE_FAST_64BIT 0' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0' def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 0' def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 0' -arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC 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) @@ -2323,9 +2323,9 @@ EOF ;; mips) - arch='sgi_mips' - target_arch='ARCH_SGI_MIPS = yes' - iproc='sgi-mips' + arch='mips' + target_arch='ARCH_MIPS = yes' + iproc='mips' if irix ; then echocheck "CPU type" 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"); -- cgit v1.2.3 From 9e8f301f22dc2743c7f979282771662e67fb1d45 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 17 Mar 2010 14:41:32 +0000 Subject: Introduce mak_enable function to set variables in config.mak. This avoids manually setting target architecture and CPU extensions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30925 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 9787014c25..7ed84bf714 100755 --- a/configure +++ b/configure @@ -1771,8 +1771,6 @@ case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) arch='x86' subarch='x86_32' - target_arch="ARCH_X86 = yes" - target_subarch="ARCH_X86_32 = yes" def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1' def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1' @@ -2012,7 +2010,6 @@ EOF ia64) arch='ia64' - target_arch='ARCH_IA64 = yes' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='ia64' ;; @@ -2020,8 +2017,6 @@ EOF x86_64|amd64) arch='x86' subarch='x86_64' - target_subarch='ARCH_X86_64 = yes' - target_arch="ARCH_X86 = yes" def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='x86_64' @@ -2115,7 +2110,6 @@ EOF sparc|sparc64) arch='sparc' - target_arch='ARCH_SPARC = yes' iproc='sparc' if test "$host_arch" = "sparc64" ; then _vis='yes' @@ -2143,13 +2137,11 @@ EOF arm*) arch='arm' - target_arch='ARCH_ARM = yes' iproc='arm' ;; avr32) arch='avr32' - target_arch='ARCH_AVR32 = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='avr32' test $_fast_clz = "auto" && _fast_clz=yes @@ -2157,14 +2149,12 @@ EOF sh|sh4) arch='sh4' - target_arch='ARCH_SH4 = yes' iproc='sh4' ;; ppc|ppc64|powerpc|powerpc64) arch='ppc' def_dcbzl='#define HAVE_DCBZL 0' - target_arch='ARCH_PPC = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1' def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1' @@ -2172,7 +2162,6 @@ EOF if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then subarch='ppc64' - target_subarch='ARCH_PPC64 = yes' def_fast_64bit='#define HAVE_FAST_64BIT 1' fi echocheck "CPU type" @@ -2281,7 +2270,6 @@ EOF alpha*) arch='alpha' - target_arch='ARCH_ALPHA = yes' iproc='alpha' echocheck "CPU type" @@ -2324,7 +2312,6 @@ EOF mips) arch='mips' - target_arch='ARCH_MIPS = yes' iproc='mips' if irix ; then @@ -2351,37 +2338,31 @@ EOF hppa) arch='pa_risc' - target_arch='ARCH_PA_RISC = yes' iproc='PA-RISC' ;; s390) arch='s390' - target_arch='ARCH_S390 = yes' iproc='390' ;; s390x) arch='s390x' - target_arch='ARCH_S390X = yes' iproc='390x' ;; vax) arch='vax' - target_arch='ARCH_VAX = yes' iproc='vax' ;; xtensa) arch='xtensa' - target_arch='ARCH_XTENSA = yes' iproc='xtensa' ;; generic) arch='generic' - target_arch='ARCH_GENERIC = yes' ;; *) @@ -8426,6 +8407,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 @@ -8492,9 +8484,9 @@ EXESUF = $_exesuf EXESUFS_ALL = .exe ARCH = $arch -$target_arch -$target_subarch -$(echo $cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/') +$(mak_enable "$arch_all" "$arch" ARCH) +$(mak_enable "$subarch_all" "$subarch" ARCH) +$(mak_enable "$cpuexts_all" "$cpuexts" HAVE) MENCODER = $_mencoder MPLAYER = $_mplayer -- cgit v1.2.3 From d5f3f8caabed594cf593765ee5b73ebd1d8bfa9b Mon Sep 17 00:00:00 2001 From: sesse Date: Wed, 17 Mar 2010 23:33:26 +0000 Subject: Announce SMP support for Win32. Don't hardcode dwNumberOfProcessors=1 for Win32 anymore; the mutex/event code is still far from perfect, but now good enough that I can't find any codecs that breaks with this (tested on a quad with various codecs). This tells codecs they can use more than one core if they want to (some already did, by launching multiple threads even when told there was only a single core). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30926 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/loader/win32.c b/loader/win32.c index d0cbddca66..826fa60d4e 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -1182,13 +1182,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; -- cgit v1.2.3 From c7dbfb6467e3fb81cd7181320a30da5d61cc2906 Mon Sep 17 00:00:00 2001 From: sesse Date: Wed, 17 Mar 2010 23:38:26 +0000 Subject: Announce Windows XP SP2 instead of Windows 95 OSR2. It's time we move to 2010: Announce Windows XP SP2 to codecs instead of Win95 OSR2. Note: We still don't support the *Ex fields in the version info struct properly (we shouldn't really overwrite the structure size, but rather check it to see if it's safe to fill the extra fields). No codec I've found seems to care. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30927 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 46 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/loader/win32.c b/loader/win32.c index 826fa60d4e..b349ee91af 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -1807,47 +1807,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; } -- cgit v1.2.3 From 67b20ea6112d99295134f2e1430e1ab9f8c88529 Mon Sep 17 00:00:00 2001 From: sesse Date: Wed, 17 Mar 2010 23:42:11 +0000 Subject: Fix thread safety issue in mreq_private: last_alloc was accessed from multiple threads without being under a mutex. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30928 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/loader/win32.c b/loader/win32.c index b349ee91af..b687135049 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -146,7 +146,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 +366,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_init(&memmut, NULL); - pthread_mutex_lock(&memmut); - } - else + pthread_mutex_lock(&memmut); + if (last_alloc) { - pthread_mutex_lock(&memmut); last_alloc->next = header; /* set next */ } -- cgit v1.2.3 From 70017fa3889084ce2c5317cf352f7581ff244d76 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Thu, 18 Mar 2010 00:45:18 +0000 Subject: Fix first line(s) of vo vdpau documentation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30929 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 5d1fcb81e9..c748f17882 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3504,8 +3504,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 -- cgit v1.2.3 From a743c0a73824f1f3bce5b59ef6d57e871d3f5022 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Mar 2010 20:44:01 +0000 Subject: Split codec path related code into a separate file to fix Windows build. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30930 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 1 + loader/codecpath.c | 26 ++++++++++++++++++++++++++ loader/codecpath.h | 12 ++++++++++++ loader/drv.c | 22 +--------------------- loader/drv.h | 1 - loader/elfdll.c | 2 +- loader/module.c | 2 +- loader/win32.c | 3 +-- mencoder.c | 2 +- mplayer.c | 2 +- 10 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 loader/codecpath.c create mode 100644 loader/codecpath.h diff --git a/Makefile b/Makefile index b698bf6289..72f8dcd524 100644 --- a/Makefile +++ b/Makefile @@ -315,6 +315,7 @@ SRCS_COMMON-$(WIN32DLL) += libmpcodecs/ad_acm.c \ libmpcodecs/vd_vfwex.c \ libmpdemux/demux_avs.c \ loader/afl.c \ + loader/codecpath.c \ loader/drv.c \ loader/vfl.c \ loader/dshow/DS_AudioDecoder.c \ diff --git a/loader/codecpath.c b/loader/codecpath.c new file mode 100644 index 0000000000..0996f592f1 --- /dev/null +++ b/loader/codecpath.c @@ -0,0 +1,26 @@ +/* + * Modified for use with MPlayer, detailed changelog at + * http://svn.mplayerhq.hu/mplayer/trunk/ + */ + +#include +#include +#include "config.h" +#include "codecpath.h" + +char* def_path = BINARY_CODECS_PATH; + +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; +} diff --git a/loader/codecpath.h b/loader/codecpath.h new file mode 100644 index 0000000000..0532e9a3a1 --- /dev/null +++ b/loader/codecpath.h @@ -0,0 +1,12 @@ +/* + * Modified for use with MPlayer, detailed changelog at + * http://svn.mplayerhq.hu/mplayer/trunk/ + */ + +#ifndef MPLAYER_CODECPATH_H +#define MPLAYER_CODECPATH_H + +extern char *def_path; +void SetCodecPath(const char* path); + +#endif /* MPLAYER_CODECPATH_H */ diff --git a/loader/drv.c b/loader/drv.c index 13945538d2..bfc57a4d1c 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 "codecpath.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..fe88227240 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 "codecpath.h" //DEFAULT_DEBUG_CHANNEL(elfdll) @@ -38,7 +39,6 @@ void dump_exports(HMODULE hModule); /*---------------- END HACKS ---------------*/ //char *extra_ld_library_path = "/usr/lib/win32"; -extern char* def_path; struct elfdll_image { diff --git a/loader/module.c b/loader/module.c index 79c01270d3..98b31125af 100644 --- a/loader/module.c +++ b/loader/module.c @@ -46,6 +46,7 @@ #endif #include "win32.h" #include "drv.h" +#include "codecpath.h" #ifdef EMU_QTX_API #include "wrapper.h" @@ -366,7 +367,6 @@ 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 path[512]; char checked[2000]; int i = -1; diff --git a/loader/win32.c b/loader/win32.c index b687135049..9ca0a4a3ab 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 "codecpath.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 diff --git a/mencoder.c b/mencoder.c index 9d4450f9ba..b8a759180f 100644 --- a/mencoder.c +++ b/mencoder.c @@ -66,7 +66,7 @@ #include "get_path.h" #ifdef CONFIG_WIN32DLL -#include "loader/drv.h" // for SetCodecPath() +#include "loader/codecpath.h" // for SetCodecPath() #endif #include "stream/stream.h" diff --git a/mplayer.c b/mplayer.c index cb9d276c3a..ac59e57795 100644 --- a/mplayer.c +++ b/mplayer.c @@ -96,7 +96,7 @@ #include "input/input.h" #ifdef CONFIG_WIN32DLL -#include "loader/drv.h" // for SetCodecPath() +#include "loader/codecpath.h" // for SetCodecPath() #endif int slave_mode=0; -- cgit v1.2.3 From 77b8678bec42c297983a99ffe084e47418a70208 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 18 Mar 2010 20:57:49 +0000 Subject: Remove unnecessary #ifdefs around harmless loader/codecpath.h #include. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30931 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 5 +---- mplayer.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/mencoder.c b/mencoder.c index b8a759180f..df916527bd 100644 --- a/mencoder.c +++ b/mencoder.c @@ -65,10 +65,7 @@ #include "mp_fifo.h" #include "get_path.h" -#ifdef CONFIG_WIN32DLL -#include "loader/codecpath.h" // for SetCodecPath() -#endif - +#include "loader/codecpath.h" #include "stream/stream.h" #include "libmpdemux/aviprint.h" #include "libmpdemux/demuxer.h" diff --git a/mplayer.c b/mplayer.c index ac59e57795..36f9155fd0 100644 --- a/mplayer.c +++ b/mplayer.c @@ -94,10 +94,7 @@ #include "gui/interface.h" #include "input/input.h" - -#ifdef CONFIG_WIN32DLL -#include "loader/codecpath.h" // for SetCodecPath() -#endif +#include "loader/codecpath.h" int slave_mode=0; int player_idle_mode=0; -- cgit v1.2.3 From 4709cde305fa0b6bb321247cce7f7e280df34d63 Mon Sep 17 00:00:00 2001 From: aurel Date: Thu, 18 Mar 2010 21:53:02 +0000 Subject: add support for lavf style extradata in vd_theora git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30932 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_theora.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libmpcodecs/vd_theora.c b/libmpcodecs/vd_theora.c index b8be6d747b..6364a4f4e4 100644 --- a/libmpcodecs/vd_theora.c +++ b/libmpcodecs/vd_theora.c @@ -27,6 +27,8 @@ #include "vd_internal.h" +#include "libavutil/intreadwrite.h" + static const vd_info_t info = { "Theora/VP3", "theora", @@ -75,6 +77,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; @@ -90,8 +94,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++) { + 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); -- cgit v1.2.3 From 3f8efed4d98c1846ff65a04645795d1698845f42 Mon Sep 17 00:00:00 2001 From: aurel Date: Thu, 18 Mar 2010 21:53:53 +0000 Subject: cosmetics: indentation git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30933 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_theora.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpcodecs/vd_theora.c b/libmpcodecs/vd_theora.c index 6364a4f4e4..cb9865b45e 100644 --- a/libmpcodecs/vd_theora.c +++ b/libmpcodecs/vd_theora.c @@ -105,8 +105,8 @@ static int init(sh_video_t *sh){ extradata += op.bytes + 2; extradata_size -= op.bytes + 2; } else { - op.bytes = ds_get_packet (sh->ds, &op.packet); - op.b_o_s = 1; + op.bytes = ds_get_packet (sh->ds, &op.packet); + op.b_o_s = 1; } if ( (errorCode = theora_decode_header (&context->inf, &context->cc, &op)) ) -- cgit v1.2.3 From e3e6f842584d582150221f16089283b7e39e7eb5 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Thu, 18 Mar 2010 23:02:32 +0000 Subject: Extend the generic path of the yuv2rgb converter with support for rgb444 output format. Patch by Janusz Krzysztofik, jkrzyszt A tis D icnet D pl git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30934 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 19 ++++++++++++++++++- libswscale/utils.c | 7 ++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 3c278d571b..de6eec6a2d 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -39,7 +39,7 @@ /* tested special converters (most are tested actually, but I did not write it down ...) - YV12 -> BGR16 + YV12 -> BGR12/BGR16 YV12 -> YV12 BGR15 -> BGR16 BGR16 -> BGR16 @@ -805,6 +805,23 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc }\ }\ break;\ + case PIX_FMT_RGB444BE:\ + case PIX_FMT_RGB444LE:\ + case PIX_FMT_BGR444BE:\ + case PIX_FMT_BGR444LE:\ + {\ + const int dr1= dither_4x4_16[y&3 ][0];\ + const int dg1= dither_4x4_16[y&3 ][1];\ + const int db1= dither_4x4_16[(y&3)^3][0];\ + const int dr2= dither_4x4_16[y&3 ][1];\ + const int dg2= dither_4x4_16[y&3 ][0];\ + const int db2= dither_4x4_16[(y&3)^3][1];\ + func(uint16_t,0)\ + ((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];\ + ((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];\ + }\ + }\ + break;\ case PIX_FMT_RGB8:\ case PIX_FMT_BGR8:\ {\ diff --git a/libswscale/utils.c b/libswscale/utils.c index 5409980eb1..91c89c02b0 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1115,7 +1115,9 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, av_log(c, AV_LOG_INFO, "from %s to %s%s ", sws_format_name(srcFormat), #ifdef DITHER1XBPP - dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? "dithered " : "", + dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 || + dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE || + dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE ? "dithered " : "", #else "", #endif @@ -1184,6 +1186,9 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR16 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); else if (dstFormat==PIX_FMT_BGR555) av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR15 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + else if (dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE || + dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE) + av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR12 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); av_log(c, AV_LOG_VERBOSE, "%dx%d -> %dx%d\n", srcW, srcH, dstW, dstH); av_log(c, AV_LOG_DEBUG, "lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n", -- cgit v1.2.3 From 0e1acdbf9b8d5f535672d999a388de266681e194 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 18 Mar 2010 23:32:14 +0000 Subject: Reuse codec path variable used in the binary loader in the XAnim loader. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30935 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_xanim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index a9926daeb2..dc8152f3d8 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -33,6 +33,7 @@ #include "mp_msg.h" #include "vd_internal.h" +#include "loader/codecpath.h" static const vd_info_t info = { "XAnim codecs", @@ -664,7 +665,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; -- cgit v1.2.3 From a04b23c3b36dd4b0281e401e2f21116a32aa5c25 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 18 Mar 2010 23:37:57 +0000 Subject: Drop support for XANIM_MOD_DIR environment variable. It is now possible to specify alternative codec paths on the comand line. Furthermore, XANIM_MOD_DIR was never properly documented. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30936 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/cs/mplayer.1 | 6 ------ DOCS/man/de/mplayer.1 | 6 ------ DOCS/man/en/mplayer.1 | 6 ------ DOCS/man/fr/mplayer.1 | 6 ------ DOCS/man/hu/mplayer.1 | 6 ------ DOCS/man/it/mplayer.1 | 6 ------ DOCS/man/ru/mplayer.1 | 6 ------ DOCS/man/zh_CN/mplayer.1 | 6 ------ libmpcodecs/vd_xanim.c | 3 --- 9 files changed, 51 deletions(-) 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 e0e0412b53..2c96710e63 100644 --- a/DOCS/man/de/mplayer.1 +++ b/DOCS/man/de/mplayer.1 @@ -11391,12 +11391,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 c748f17882..703b065ffe 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -11317,12 +11317,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 ad7a42ac7b..1e96215b26 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -11697,12 +11697,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..63d744d830 100644 --- a/DOCS/man/zh_CN/mplayer.1 +++ b/DOCS/man/zh_CN/mplayer.1 @@ -10560,12 +10560,6 @@ FIXME: 待解释。 .B USERPROFILE FIXME: 待解释。 . -.SS libmpcodecs: -. -.TP -.B XANIM_MOD_DIR -FIXME: 待解释。 -. .SS GUI: . .TP diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index dc8152f3d8..6067e5add6 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -683,9 +683,6 @@ 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); if (xacodec_load(sh, dll) == 0) return 0; -- cgit v1.2.3 From 2406c2340640189c7d6f17407222cc243a71141c Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 19 Mar 2010 09:57:36 +0000 Subject: Check whether COMPILE_ALTIVEC is defined, not if it is set to a 0/1 value. COMPILE_ALTIVEC is never set to 1, it is just #defined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30937 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index de6eec6a2d..1d255bcb39 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1262,7 +1262,7 @@ SwsFunc ff_getSwsFunc(SwsContext *c) } #else -#if ARCH_PPC && COMPILE_ALTIVEC +#if ARCH_PPC && defined(COMPILE_ALTIVEC) if (flags & SWS_CPU_CAPS_ALTIVEC) { sws_init_swScale_altivec(c); return swScale_altivec; -- cgit v1.2.3 From 0f759a5da0a280526bb60e9f54e2ee634aaa7e44 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 19 Mar 2010 09:58:45 +0000 Subject: Replace wrong condition name in #endif comment by correct instance. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30938 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 48450f7629..e37837a53d 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2211,7 +2211,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, in dst[i] = FFMIN(val>>7, (1<<15)-1); // the cubic equation does overflow ... //dst[i] = val>>7; } -#endif /* COMPILE_ALTIVEC */ +#endif /* COMPILE_TEMPLATE_ALTIVEC */ #endif /* COMPILE_MMX */ } -- cgit v1.2.3 From 498bd63ccc3a893bf949a00adb1e19ff3a75d1c9 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 19 Mar 2010 19:42:23 +0000 Subject: Use vd_raw to handle NV12/NV21 formats, since we support them as pixel formats there is no need to do any conversion during decoding. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30939 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index 73a3bc3257..e2691909e0 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -3246,20 +3246,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" -- cgit v1.2.3 From 443a427b0e1742f5877b29ff57086188ee691614 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 19 Mar 2010 19:44:02 +0000 Subject: Remove unnecessary size limits and a related define for hm12 decoder. Patch by Stephen Warren [swarren nvidia com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30940 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_hmblck.c | 7 ------- 1 file changed, 7 deletions(-) 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"); -- cgit v1.2.3 From 64c4d367afac0e19c811fe48fb86a5786d5a2238 Mon Sep 17 00:00:00 2001 From: jrash Date: Sat, 20 Mar 2010 01:33:54 +0000 Subject: sync with en/mplayer.1 rev. 30936 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30941 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/zh_CN/mplayer.1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1 index 63d744d830..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 硬件解码视频的视频输出方式。 同时支持显示软件解码的视频。 -- cgit v1.2.3 From a06a3d476d268f9e17769916ebabf684af95e5e4 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 20 Mar 2010 23:27:07 +0000 Subject: Move SetCodecPath() from loader to get_path.c and make it unconditional. This fixes compilation with the Win32 loader disabled but other binary codec loaders enabled. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30942 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 1 - cfg-common-opts.h | 2 -- get_path.c | 18 ++++++++++++++++++ get_path.h | 3 +++ libmpcodecs/vd_xanim.c | 3 +-- loader/codecpath.c | 26 -------------------------- loader/codecpath.h | 12 ------------ loader/drv.c | 2 +- loader/elfdll.c | 2 +- loader/module.c | 2 +- loader/win32.c | 2 +- mencoder.c | 3 --- mplayer.c | 3 --- 13 files changed, 26 insertions(+), 53 deletions(-) delete mode 100644 loader/codecpath.c delete mode 100644 loader/codecpath.h diff --git a/Makefile b/Makefile index 72f8dcd524..b698bf6289 100644 --- a/Makefile +++ b/Makefile @@ -315,7 +315,6 @@ SRCS_COMMON-$(WIN32DLL) += libmpcodecs/ad_acm.c \ libmpcodecs/vd_vfwex.c \ libmpdemux/demux_avs.c \ loader/afl.c \ - loader/codecpath.c \ loader/drv.c \ loader/vfl.c \ loader/dshow/DS_AudioDecoder.c \ diff --git a/cfg-common-opts.h b/cfg-common-opts.h index 7c85e8885a..377472a891 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -40,9 +40,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", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL}, // ------------------------- stream options -------------------- diff --git a/get_path.c b/get_path.c index ad3c422639..90d428a4df 100644 --- a/get_path.c +++ b/get_path.c @@ -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 *def_path = BINARY_CODECS_PATH; + +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; +} diff --git a/get_path.h b/get_path.h index 2f1909b601..6713762937 100644 --- a/get_path.h +++ b/get_path.h @@ -21,7 +21,10 @@ #ifndef MPLAYER_GET_PATH_H #define MPLAYER_GET_PATH_H +extern char *def_path; + char *get_path(const char *filename); void set_path_env(void); +void SetCodecPath(const char *path); #endif /* MPLAYER_GET_PATH_H */ diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index 6067e5add6..66fbb95175 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -29,11 +29,10 @@ #include /* strerror */ #include "config.h" - +#include "get_path.h" #include "mp_msg.h" #include "vd_internal.h" -#include "loader/codecpath.h" static const vd_info_t info = { "XAnim codecs", diff --git a/loader/codecpath.c b/loader/codecpath.c deleted file mode 100644 index 0996f592f1..0000000000 --- a/loader/codecpath.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Modified for use with MPlayer, detailed changelog at - * http://svn.mplayerhq.hu/mplayer/trunk/ - */ - -#include -#include -#include "config.h" -#include "codecpath.h" - -char* def_path = BINARY_CODECS_PATH; - -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; -} diff --git a/loader/codecpath.h b/loader/codecpath.h deleted file mode 100644 index 0532e9a3a1..0000000000 --- a/loader/codecpath.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Modified for use with MPlayer, detailed changelog at - * http://svn.mplayerhq.hu/mplayer/trunk/ - */ - -#ifndef MPLAYER_CODECPATH_H -#define MPLAYER_CODECPATH_H - -extern char *def_path; -void SetCodecPath(const char* path); - -#endif /* MPLAYER_CODECPATH_H */ diff --git a/loader/drv.c b/loader/drv.c index bfc57a4d1c..ece4aa3456 100644 --- a/loader/drv.c +++ b/loader/drv.c @@ -25,7 +25,7 @@ #ifndef __MINGW32__ #include "ext.h" #endif -#include "codecpath.h" +#include "get_path.h" #if 1 diff --git a/loader/elfdll.c b/loader/elfdll.c index fe88227240..b0317bf91a 100644 --- a/loader/elfdll.c +++ b/loader/elfdll.c @@ -18,7 +18,7 @@ #include "wine/debugtools.h" #include "wine/winerror.h" #include "debug.h" -#include "codecpath.h" +#include "get_path.h" //DEFAULT_DEBUG_CHANNEL(elfdll) diff --git a/loader/module.c b/loader/module.c index 98b31125af..0d4f8087ce 100644 --- a/loader/module.c +++ b/loader/module.c @@ -46,7 +46,7 @@ #endif #include "win32.h" #include "drv.h" -#include "codecpath.h" +#include "get_path.h" #ifdef EMU_QTX_API #include "wrapper.h" diff --git a/loader/win32.c b/loader/win32.c index 9ca0a4a3ab..52a7b2c6c5 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -49,7 +49,7 @@ for DLL to know too much about its environment. #include "loader.h" #include "com.h" #include "ext.h" -#include "codecpath.h" +#include "get_path.h" #include #include diff --git a/mencoder.c b/mencoder.c index df916527bd..dcddaa649a 100644 --- a/mencoder.c +++ b/mencoder.c @@ -65,7 +65,6 @@ #include "mp_fifo.h" #include "get_path.h" -#include "loader/codecpath.h" #include "stream/stream.h" #include "libmpdemux/aviprint.h" #include "libmpdemux/demuxer.h" @@ -667,10 +666,8 @@ if (frameno_filename) { set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) SetCodecPath(codec_path); -#endif // check font #ifdef CONFIG_FREETYPE diff --git a/mplayer.c b/mplayer.c index 36f9155fd0..3602a04e82 100644 --- a/mplayer.c +++ b/mplayer.c @@ -94,7 +94,6 @@ #include "gui/interface.h" #include "input/input.h" -#include "loader/codecpath.h" int slave_mode=0; int player_idle_mode=0; @@ -2702,10 +2701,8 @@ int gui_no_filename=0; set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) SetCodecPath(codec_path); -#endif #ifndef CONFIG_GUI if(use_gui){ -- cgit v1.2.3 From 70c66c04764421ca277c341657c556cb0f00ec9b Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 20 Mar 2010 23:38:27 +0000 Subject: Rename get_path.[ch] --> path.[ch]. These files now contain different functions related to path handling. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30943 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 2 +- command.c | 2 +- get_path.c | 195 ------------------------------------------------- get_path.h | 30 -------- gui/cfg.c | 2 +- gui/interface.c | 2 +- gui/win32/dialogs.c | 2 +- gui/win32/interface.c | 2 +- gui/win32/wincfg.c | 2 +- input/input.c | 2 +- libaf/af_export.c | 2 +- libass/ass_mp.c | 2 +- libmpcodecs/vd_xanim.c | 2 +- libvo/font_load_ft.c | 2 +- libvo/vo_dxr2.c | 2 +- loader/drv.c | 2 +- loader/elfdll.c | 2 +- loader/module.c | 2 +- loader/registry.c | 2 +- loader/win32.c | 2 +- mencoder.c | 2 +- mplayer.c | 2 +- path.c | 195 +++++++++++++++++++++++++++++++++++++++++++++++++ path.h | 30 ++++++++ stream/stream_dvb.c | 2 +- 25 files changed, 246 insertions(+), 246 deletions(-) delete mode 100644 get_path.c delete mode 100644 get_path.h create mode 100644 path.c create mode 100644 path.h diff --git a/Makefile b/Makefile index b698bf6289..4773345028 100644 --- a/Makefile +++ b/Makefile @@ -344,12 +344,12 @@ SRCS_COMMON = asxparser.c \ edl.c \ find_sub.c \ fmt-conversion.c \ - get_path.c \ m_config.c \ m_option.c \ m_struct.c \ mpcommon.c \ parser-cfg.c \ + path.c \ playtree.c \ playtreeparser.c \ spudec.c \ diff --git a/command.c b/command.c index cd9d2abf5d..a62e0bb77f 100644 --- a/command.c +++ b/command.c @@ -46,7 +46,7 @@ #include "libmpcodecs/dec_teletext.h" #include "vobsub.h" #include "spudec.h" -#include "get_path.h" +#include "path.h" #include "stream/tv.h" #include "stream/stream_radio.h" #include "stream/pvr.h" diff --git a/get_path.c b/get_path.c deleted file mode 100644 index 90d428a4df..0000000000 --- a/get_path.c +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Get path to config dir/file. - * - * Return Values: - * Returns the pointer to the ALLOCATED buffer containing the - * zero terminated path string. This buffer has to be FREED - * by the caller. - * - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include "config.h" -#include "mp_msg.h" -#include "get_path.h" - -#ifdef CONFIG_MACOSX_BUNDLE -#include -#include -#include -#include -#elif defined(__MINGW32__) -#include -#elif defined(__CYGWIN__) -#include -#include -#endif - -#include "osdep/osdep.h" - -char *get_path(const char *filename){ - char *homedir; - char *buff; -#ifdef __MINGW32__ - static char *config_dir = "/mplayer"; -#else - static char *config_dir = "/.mplayer"; -#endif - int len; -#ifdef CONFIG_MACOSX_BUNDLE - struct stat dummy; - CFIndex maxlen=256; - CFURLRef res_url_ref=NULL; - CFURLRef bdl_url_ref=NULL; - char *res_url_path = NULL; - char *bdl_url_path = NULL; -#endif - - if ((homedir = getenv("MPLAYER_HOME")) != NULL) - config_dir = ""; - else if ((homedir = getenv("HOME")) == NULL) -#if defined(__MINGW32__) || defined(__CYGWIN__) - /* Hack to get fonts etc. loaded outside of Cygwin environment. */ - { - int i,imax=0; - char exedir[260]; - GetModuleFileNameA(NULL, exedir, 260); - for (i=0; i< strlen(exedir); i++) - if (exedir[i] =='\\') - {exedir[i]='/'; imax=i;} - exedir[imax]='\0'; - homedir = exedir; - } -#elif defined(__OS2__) - { - PPIB ppib; - char path[260]; - - // Get process info blocks - DosGetInfoBlocks(NULL, &ppib); - - // Get full path of the executable - DosQueryModuleName(ppib->pib_hmte, sizeof( path ), path); - - // Truncate name part including last backslash - *strrchr(path, '\\') = 0; - - // Convert backslash to slash - _fnslashify(path); - - homedir = path; - } -#else - return NULL; -#endif - len = strlen(homedir) + strlen(config_dir) + 1; - if (filename == NULL) { - if ((buff = malloc(len)) == NULL) - return NULL; - sprintf(buff, "%s%s", homedir, config_dir); - } else { - len += strlen(filename) + 1; - if ((buff = malloc(len)) == NULL) - return NULL; - sprintf(buff, "%s%s/%s", homedir, config_dir, filename); - } - -#ifdef CONFIG_MACOSX_BUNDLE - if (stat(buff, &dummy)) { - - res_url_ref=CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); - bdl_url_ref=CFBundleCopyBundleURL(CFBundleGetMainBundle()); - - if (res_url_ref&&bdl_url_ref) { - - res_url_path=malloc(maxlen); - bdl_url_path=malloc(maxlen); - - while (!CFURLGetFileSystemRepresentation(res_url_ref, true, res_url_path, maxlen)) { - maxlen*=2; - res_url_path=realloc(res_url_path, maxlen); - } - CFRelease(res_url_ref); - - while (!CFURLGetFileSystemRepresentation(bdl_url_ref, true, bdl_url_path, maxlen)) { - maxlen*=2; - bdl_url_path=realloc(bdl_url_path, maxlen); - } - CFRelease(bdl_url_ref); - - if (strcmp(res_url_path, bdl_url_path) == 0) - res_url_path = NULL; - } - - if (res_url_path&&filename) { - if ((strlen(filename)+strlen(res_url_path)+2)>maxlen) { - maxlen=strlen(filename)+strlen(res_url_path)+2; - } - free(buff); - buff = malloc(maxlen); - strcpy(buff, res_url_path); - - strcat(buff,"/"); - strcat(buff, filename); - } - } -#endif - mp_msg(MSGT_GLOBAL,MSGL_V,"get_path('%s') -> '%s'\n",filename,buff); - return buff; -} - -#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) -void set_path_env(void) -{ - /*make our codec dirs available for LoadLibraryA()*/ - char win32path[MAX_PATH]; -#ifdef __CYGWIN__ - cygwin_conv_to_full_win32_path(BINARY_CODECS_PATH, win32path); -#else /*__CYGWIN__*/ - /* Expand to absolute path unless it's already absolute */ - if (!strstr(BINARY_CODECS_PATH,":") && BINARY_CODECS_PATH[0] != '\\') { - GetModuleFileNameA(NULL, win32path, MAX_PATH); - strcpy(strrchr(win32path, '\\') + 1, BINARY_CODECS_PATH); - } - else strcpy(win32path, BINARY_CODECS_PATH); -#endif /*__CYGWIN__*/ - mp_msg(MSGT_WIN32, MSGL_V, "Setting PATH to %s\n", win32path); - if (!SetEnvironmentVariableA("PATH", win32path)) - mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); -} -#endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ - -char *def_path = BINARY_CODECS_PATH; - -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; -} diff --git a/get_path.h b/get_path.h deleted file mode 100644 index 6713762937..0000000000 --- a/get_path.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Get path to config dir/file. - * - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it an