1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 21:06:00 +00:00

Merge svn changes up to r28461

This commit is contained in:
Uoti Urpala 2009-02-04 00:28:17 +02:00
commit 9790f4e6e7
42 changed files with 261 additions and 340 deletions

View File

@ -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

View File

@ -9100,6 +9100,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).
.

View File

@ -26,13 +26,21 @@ answers.
<itemizedlist>
<listitem><para>
<emphasis role="bold">binutils</emphasis> - recommended version is
<emphasis role="bold">2.11.x</emphasis>.
<emphasis role="bold">POSIX system</emphasis> - You need a POSIX-compatible
shell and POSIX-compatible system tools like grep, sed, awk, etc. in your
path.
</para></listitem>
<listitem><para>
<emphasis role="bold">gcc</emphasis> - 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.
<emphasis role="bold">GNU make</emphasis> 3.81 or later
</para></listitem>
<listitem><para>
<emphasis role="bold">binutils</emphasis> - GNU binutils 2.11 or later
is known to work.
</para></listitem>
<listitem><para>
<emphasis role="bold">compiler</emphasis> - 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.
</para></listitem>
<listitem><para>
<emphasis role="bold">Xorg/XFree86</emphasis> - recommended version is
@ -41,9 +49,6 @@ answers.
too, otherwise it won't work.
You don't absolutely need X, some video output drivers work without it.
</para></listitem>
<listitem><para>
<emphasis role="bold">GNU make</emphasis> 3.81
</para></listitem>
<listitem><para>
<emphasis role="bold">FreeType</emphasis> - 2.0.9 or later is required
for the OSD and subtitles

View File

@ -3,18 +3,18 @@
<chapter id="ports" xreflabel="Ports">
<title>Ports</title>
<sect1 id="linux">
<title>Linux</title>
<para>
The main development platform is Linux on x86, although
<application>MPlayer</application> works on many other Linux ports.
Binary packages of <application>MPlayer</application> are available from several
sources.
sources. We have a list of places to get
<ulink url="http://www.mplayerhq.hu/design7/projects.html#unofficial_packages">unofficial packages</ulink>
for various systems on our homepage.
However, <emphasis role="bold">none of these packages are supported</emphasis>.
Report problems to the authors, not to us.
</para>
<sect1 id="linux">
<title>Linux</title>
<!-- ********** -->
<sect2 id="debian">
@ -45,13 +45,6 @@ As root you can then install the <filename>.deb</filename> package as usual:
<screen>dpkg -i ../mplayer_<replaceable>version</replaceable>.deb</screen>
</para>
<para>
Christian Marillat has been making unofficial Debian packages of
<application>MPlayer</application>, <application>MEncoder</application> and
our binary codec packages for a while, you can (apt-)get them from
<ulink url="http://www.debian-multimedia.org/">his homepage</ulink>.
</para>
</sect2>
<!-- ********** -->
@ -60,25 +53,17 @@ our binary codec packages for a while, you can (apt-)get them from
<title>RPM packaging</title>
<para>
Dominik Mierzejewski maintains the official RPM packages of
<application>MPlayer</application> for Fedora and CentOS/RHEL. They are available
from <ulink url="http://rpmfusion.org/">RPMFusion repository</ulink>.
</para>
To build an RPM package, run the following command in the
<application>MPlayer</application> source directory:
<para>
Mandrake/Mandriva RPM packages are available from the
<ulink url="http://plf.zarb.org/">P.L.F.</ulink>.
SUSE used to include a crippled version of <application>MPlayer</application>
in their distribution. They have removed it in their latest releases. You can
get working RPMs from
<ulink url="http://packman.links2linux.de/?action=128">links2linux.de</ulink>.
<screen>FIXME: insert proper commands here</screen>
</para>
</sect2>
<!-- ********** -->
<sect2 id="arm">
<title>ARM</title>
<sect2 id="arm_linux">
<title>ARM Linux</title>
<para>
<application>MPlayer</application> works on Linux PDAs with ARM CPU e.g. Sharp
@ -109,11 +94,6 @@ There are ports/pkgsrc/fink/etc versions of <application>MPlayer</application>
available that are probably easier to use than our raw sources.
</para>
<para>
To build <application>MPlayer</application> you will need GNU make
(gmake - native BSD make will not work) and a recent version of binutils.
</para>
<para>
If <application>MPlayer</application> complains about not finding
<filename>/dev/cdrom</filename> or <filename>/dev/dvd</filename>,
@ -187,6 +167,13 @@ adjustments to make the build work.
<sect2 id="solaris">
<title>Solaris</title>
<para>
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 <filename>/usr/xpg4/bin</filename> to your
<systemitem>PATH</systemitem>.
</para>
<para>
<application>MPlayer</application> should work on Solaris 2.6 or newer.
Use the SUN audio driver with the <option>-ao sun</option> option for sound.
@ -222,17 +209,6 @@ installed.
</para></listitem>
</itemizedlist>
<para>
To build the package you will need GNU <application>make</application>
(<filename>gmake</filename>, <filename>/opt/sfw/gmake</filename>), native
Solaris make will not work. Typical error you get when building with
Solaris' make instead of GNU make:
<screen>
% /usr/ccs/bin/make
make: Fatal error in reader: Makefile, line 25: Unexpected end of line seen
</screen>
</para>
<para>
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.
@ -339,34 +315,6 @@ you may not be able to play DVD discs larger than 4 GB:
<!-- ********** -->
<sect2 id="irix">
<title>IRIX</title>
<para>
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:
<screen>
./configure --with-install=<replaceable>/path/and/name/of/install</replaceable>
</screen>
</para>
<para>
Or you can use the default install delivered with IRIX 6.5 in which case
you will have to edit the <filename>Makefile</filename> by hand a little bit.
Change the line:
<programlisting>
$(INSTALL) -c -m 644 DOCS/mplayer.1 $(MANDIR)/man1/mplayer.1
</programlisting>
to:
<programlisting>
$(INSTALL) -m 644 mplayer.1 $(MANDIR)/man1/
</programlisting>
and then go on with building and installing.
</para>
</sect2>
<!-- ********** -->
<sect2 id="hp-ux">
<title>HP-UX</title>
@ -378,7 +326,7 @@ work out of the box. The following information is taken from this HOWTO.
</para>
<para>
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 +437,6 @@ untested. It is highly recommended that you build
or if you are building on POWER5, GCC 4.0 is required.
</para>
<para>
Ensure that you are using GNU make
(<filename>/opt/freeware/bin/gmake</filename>) to build
<application>MPlayer</application>, as you will encounter problems if
you use <filename>/usr/ccs/bin/make</filename>.
</para>
<para>
CPU detection is still a work in progress.
The following architectures have been tested:
@ -549,6 +490,23 @@ Messages in the GTK-2 interface will be broken then.<!--
</listitem>
</itemizedlist>
</sect2>
<!-- ********** -->
<sect2 id="qnx">
<title>QNX</title>
<para>
You'll need to download and install SDL for QNX. Then run
<application>MPlayer</application> with <option>-vo sdl:driver=photon</option>
and <option>-ao sdl:nto</option> options, it should be fast.
</para>
<para>
The <option>-vo x11</option> output will be even slower than on Linux,
since QNX has only X <emphasis>emulation</emphasis> which is very slow.
</para>
</sect2>
</sect1>
@ -695,11 +653,9 @@ Instructions and files for making SDL run under
<title><application>MinGW</application></title>
<para>
Installing a version of <application>MinGW</application> that could
compile <application>MPlayer</application> used to be quite tricky, but it
works out of the box now. Just install <application>MinGW</application>
3.1.0 or later and MSYS 1.0.9 or later and tell the MSYS postinstall that
<application>MinGW</application> is installed.
You need <application>MinGW</application> 3.1.0 or later and MSYS 1.0.9 or
later. Tell the MSYS postinstall that <application>MinGW</application> is
installed.
</para>
<para>
@ -882,71 +838,4 @@ not work anymore.
</sect2>
</sect1>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="exotic_platforms">
<title>Exotic Platforms</title>
<para>
<application>MPlayer</application> 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.
</para>
<!-- ********** -->
<sect2 id="qnx">
<title>QNX</title>
<para>
You'll need to download and install SDL for QNX. Then run
<application>MPlayer</application> with <option>-vo sdl:driver=photon</option>
and <option>-ao sdl:nto</option> options, it should be fast.
</para>
<para>
The <option>-vo x11</option> output will be even slower than on Linux,
since QNX has only X <emphasis>emulation</emphasis> which is very slow.
</para>
</sect2>
<!-- ********** -->
<sect2 id="amiga">
<title>Amiga/MorphOS (GeekGadgets)</title>
<para>
The people over at
<ulink url="http://www.amigasoft.net">www.amigasoft.net</ulink>
make current <application>MPlayer</application> and
<application>MEncoder</application> packages.
</para>
<para>
Nicholas Det at Genesi has done a big and powerful port of <application>MPlayer
</application> for MorphOS. Sadly it's based on the 0.90 series.
</para>
<para>
Get if from <ulink url="http://www.morphzone.org/">MorphZone</ulink>:
<itemizedlist>
<listitem><para>
<ulink url="http://www.morphzone.org/modules/mydownloads/singlefile.php?lid=90">
<application>MPlayer</application> 0.91 binary</ulink>
</para></listitem>
<listitem><para>
<ulink url="http://www.morphzone.org/modules/mydownloads/singlefile.php?lid=91">
<application>MPlayer</application> 0.91 source</ulink>
</para></listitem>
<listitem><para>
<ulink url="http://www.morphzone.org/modules/mydownloads/singlefile.php?lid=92">
<application>MEncoder</application> 1.0pre3 binary</ulink>
</para></listitem>
</itemizedlist>
</para>
</sect2>
</sect1>
</chapter>

View File

@ -873,8 +873,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))
@ -909,7 +909,7 @@ install-mencoder-man-en: install-mplayer-man-en
install-mplayer-man-en:
if test ! -d $(MANDIR)/man1 ; then $(INSTALL) -d $(MANDIR)/man1 ; fi
$(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)
@ -919,7 +919,7 @@ endef
define MPLAYER_MAN_RULE
install-mplayer-man-$(lang):
if test ! -d $(MANDIR)/$(lang)/man1 ; then $(INSTALL) -d $(MANDIR)/$(lang)/man1 ; fi
$(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)))

2
README
View File

@ -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.

View File

@ -28,7 +28,7 @@
#include "config.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

126
configure vendored
View File

@ -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(){
@ -1690,6 +1690,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)
@ -2057,7 +2058,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'
@ -2501,10 +2502,17 @@ 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
#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
@ -2515,7 +2523,6 @@ EOF
if $(cc_check -maltivec -mabi=altivec) ; then
_altivec_gcc_flags="-maltivec -mabi=altivec"
# check if <altivec.h> should be included
def_altivec_h='#undef HAVE_ALTIVEC_H'
cat > $TMPC << EOF
#include <altivec.h>
int main(void) { return 0; }
@ -2617,7 +2624,7 @@ EOF
echores "$_iwmmxt"
fi
_cpuexts_all='ALTIVEC BSWAP MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI'
_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI'
test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
@ -2636,9 +2643,6 @@ test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts"
test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
if x86 ; then
_cpuexts="BSWAP $_cpuexts"
fi
# Checking kernel version...
if x86_32 && linux ; then
@ -2848,7 +2852,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
@ -2913,63 +2917,46 @@ 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
_use_aton=no
echocheck "inet_pton()"
def_inet_pton='#define HAVE_INET_PTON 0'
inet_pton=no
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
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
# NOTE: Linux has libresolv but does not need it
:
test $_ld_sock && _res_comment="using $_ld_sock"
echores "yes"
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"
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()"
cat > $TMPC << EOF
echocheck "inet_aton()"
def_inet_aton='#define HAVE_INET_ATON 0'
inet_aton=no
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
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"
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"
fi
echores "$_use_aton"
fi
_def_use_aton='#undef HAVE_ATON'
if test "$_use_aton" = yes; then
_def_use_aton='#define HAVE_ATON 1'
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'
fi
echores "$inet_aton"
echocheck "socklen_t"
@ -2984,7 +2971,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"
@ -2999,13 +2986,14 @@ 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"
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"
@ -3130,6 +3118,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 <malloc.h>
int main(void) { (void) memalign(64, sizeof(char)); return 0; }
@ -3581,6 +3570,7 @@ echores "$_vsscanf"
echocheck "swab()"
cat > $TMPC << EOF
#define _XOPEN_SOURCE
#include <unistd.h>
int main(void) { swab(0, 0, 0); return 0; }
EOF
@ -6368,7 +6358,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"
@ -6927,7 +6917,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"
@ -6960,7 +6950,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"
@ -7003,7 +6993,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"
@ -7035,7 +7025,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"
@ -7126,7 +7116,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"
@ -8278,7 +8268,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 */
@ -8307,7 +8297,6 @@ $_def_lrint
$_def_lrintf
$_def_map_memalign
$_def_memalign
$_def_memalign_hack
$_def_nanosleep
$_def_posix_select
$_def_round
@ -8494,12 +8483,13 @@ $_def_fribidi
$_def_closesocket
$_def_ftp
$_def_inet6
$def_inet_aton
$def_inet_pton
$_def_live
$_def_nemesi
$_def_network
$_def_smb
$_def_socklen_t
$_def_use_aton
$_def_vstream
@ -8595,20 +8585,36 @@ $_def_libswscale
$_def_libswscale_a
$_def_libswscale_so
$def_bswap
$_def_dcbzl
$def_fast_64bit
$_def_fast_unaligned
$_def_memalign_hack
$def_mlib
$_def_mkstemp
$_def_pthreads
$_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
#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
/* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
#define CONFIG_AANDCT 1
#define CONFIG_FFT 1

View File

@ -5,6 +5,7 @@
(see http://www.dtek.chalmers.se/~dvd/)
*/
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -1,3 +1,4 @@
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -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,13 +69,13 @@ 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");
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");

View File

@ -27,7 +27,7 @@ LIBVD_EXTERN(ffmpeg)
#include "libavcodec/avcodec.h"
#ifdef CONFIG_XVMC
#if CONFIG_XVMC
#include "xvmc_render.h"
#endif
@ -61,7 +61,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);
@ -125,7 +125,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;
@ -233,7 +233,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){
@ -517,7 +517,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
@ -895,7 +895,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;

View File

@ -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,

View File

@ -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* 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

View File

@ -348,12 +348,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,
@ -856,7 +856,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;
@ -2872,8 +2872,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)
{

View File

@ -22,7 +22,7 @@
#define SWSCALE_SWSCALE_H
/**
* @file swscale.h
* @file libswscale/swscale.h
* @brief
* external api for the swscale stuff
*/

View File

@ -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 <ollie@sis.com.tw>
*

View File

@ -8,16 +8,12 @@
#include <malloc.h>
#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 "talloc.h"
#include "mplayer.h"

View File

@ -50,7 +50,7 @@ typedef struct mp_osd_obj_s {
} mp_osd_obj_t;
struct osd_state {
unsigned char osd_text[64];
unsigned char osd_text[128];
struct font_desc *sub_font;
};

View File

@ -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;
@ -437,7 +437,7 @@ static int configure_d3d(void)
if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device,
&vp))) {
mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>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, "<vo_direct3d>Unable to initialize Direct3D\n");
return -1;
return 0;
}
/* Configure Direct3D */
@ -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
@ -519,7 +520,7 @@ static int resize_d3d(void)
if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device,
&vp))) {
mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to set the viewport\n");
return VO_ERROR;
return 0;
}
calc_fs_rect();
@ -565,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;
@ -857,21 +863,16 @@ 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,
"<vo_direct3d>Video adapter became uncooperative.\n");
mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Trying to reinitialize it...\n");
"<vo_direct3d>Trying to reinitialize uncooperative video adapter.\n");
if (!reconfigure_d3d()) {
mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization Failed.\n");
return;
}
if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) {
mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization Failed.\n");
mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization failed.\n");
return;
}
else
mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Video adapter reinitialized.\n");
}
}
@ -914,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,
@ -1022,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.*/

View File

@ -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"
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);
}
/**

View File

@ -1310,7 +1310,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;
@ -1347,9 +1347,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;
@ -1492,12 +1492,12 @@ static void update_osd_msg(struct MPContext *mpctx)
{
mp_osd_msg_t *msg;
struct osd_state *osd = mpctx->osd;
char osd_text_timer[64];
char osd_text_timer[128];
// Look if we have a msg
if((msg = get_osd_msg(mpctx))) {
if (strcmp(osd->osd_text, msg->msg)) {
strncpy(osd->osd_text, msg->msg, 63);
strncpy(osd->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);
}
@ -2283,8 +2283,8 @@ static double update_video(struct MPContext *mpctx, int *blit_frame)
sh_video->pts = pts;
if (sh_video->last_pts == MP_NOPTS_VALUE)
sh_video->last_pts = sh_video->pts;
else if (sh_video->last_pts >= sh_video->pts) {
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Non-increasing video pts: %f <= %f\n",
else if (sh_video->last_pts > sh_video->pts) {
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Decreasing video pts: %f < %f\n",
sh_video->pts, sh_video->last_pts);
/* If the difference in pts is small treat it as jitter around the
* right value (possibly caused by incorrect timestamp ordering) and

View File

@ -39,7 +39,7 @@
#include "mp_msg.h"
#include "help_mp.h"
#ifdef HAVE_WINSOCK2_H
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#endif

View File

@ -10,7 +10,7 @@
#include "help_mp.h"
#include "options.h"
#ifdef HAVE_WINSOCK2_H
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#endif

View File

@ -11,7 +11,7 @@
#include <string.h>
#include <unistd.h>
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#else
#include <winsock2.h>
#include <ws2tcpip.h>

View File

@ -42,7 +42,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <inttypes.h>
#ifdef HAVE_WINSOCK2_H
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#include <sys/socket.h>
@ -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))) {

View File

@ -28,7 +28,7 @@
#include "config.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
@ -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,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
#ifndef HAVE_WINSOCK2_H
#ifdef HAVE_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);
@ -332,7 +330,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,13 +384,11 @@ is_multicast_address (char *addr)
sin.sin_family = AF_INET;
#ifndef HAVE_WINSOCK2_H
#ifdef HAVE_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

View File

@ -30,7 +30,7 @@
#include <sys/types.h>
#include "config.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

View File

@ -19,7 +19,7 @@
#include "mp_msg.h"
#include "help_mp.h"
#ifdef HAVE_WINSOCK2_H
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#include <ws2tcpip.h>
#endif

View File

@ -12,7 +12,7 @@
#include <sys/types.h>
#include "config.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.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

View File

@ -35,7 +35,7 @@
#include <stdlib.h>
#include <sys/time.h>
#include <inttypes.h>
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <sys/socket.h>
//#include <netinet/in.h>
//#include <netdb.h>
@ -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)) {

View File

@ -31,7 +31,7 @@
#include <sys/types.h>
#include "config.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

View File

@ -13,7 +13,7 @@
#include <sys/types.h>
#include <ctype.h>
#include "config.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>

View File

@ -14,7 +14,7 @@
#include "config.h"
#ifdef HAVE_WINSOCK2_H
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
@ -406,7 +406,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)
@ -441,7 +441,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

View File

@ -27,7 +27,7 @@
#define mkdir(a,b) mkdir(a)
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#else

View File

@ -9,7 +9,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <sys/socket.h>
#else
#include <winsock2.h>

View File

@ -42,7 +42,7 @@
#include <inttypes.h>
#include <errno.h>
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@ -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));

View File

@ -14,7 +14,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <sys/socket.h>
#endif
#include "mp_msg.h"

View File

@ -28,7 +28,7 @@
#include <sys/types.h>
#include <ctype.h>
#include "config.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>

View File

@ -20,7 +20,7 @@
#include "mp_msg.h"
#include "help_mp.h"
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
@ -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,13 +115,11 @@ 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 (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
{
@ -139,7 +137,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) );
@ -164,7 +162,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);
@ -172,14 +170,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 +209,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;

View File

@ -31,7 +31,7 @@
#include <sys/time.h>
#include <ctype.h>
#ifndef HAVE_WINSOCK2_H
#if !HAVE_WINSOCK2_H
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
@ -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,15 +91,13 @@ udp_open_socket (URL_t *url)
}
else
{
#ifndef HAVE_WINSOCK2_H
#ifdef HAVE_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_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);
@ -110,7 +108,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 +120,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);