]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/ffmpeg.patch.cvs
ffmpeg.patch.cvs: workaround buggy lrintf detection when cross compiling
[vlc] / extras / contrib / src / Patches / ffmpeg.patch.cvs
1 diff -ru ffmpeg-orig/configure ffmpeg/configure
2 --- ffmpeg-orig/configure       2005-02-28 01:05:48.000000000 +0100
3 +++ ffmpeg/configure    2005-03-01 21:39:22.000000000 +0100
4 @@ -212,7 +212,7 @@
5  2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
6  mmx="no"
7  ;;
8 -*20010315*) echo "BeBits gcc"
9 +*20010315*|2.95.3*) echo "BeBits gcc"
10  CFLAGS="$CFLAGS -fno-expensive-optimizations"
11  ;;
12  esac
13 @@ -387,7 +387,7 @@
14    ;;
15    --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
16    ;;
17 -  --extra-libs=*) extralibs=${opt#--extra-libs=}
18 +  --extra-libs=*) extralibs="$extralibs ${opt#--extra-libs=}"
19    ;;
20    --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
21    ;;
22 @@ -740,6 +740,18 @@
23  ranlib="${cross_prefix}${ranlib}"
24  strip="${cross_prefix}${strip}"
25  
26 +if test "${cross_prefix}" = "i586-pc-beos-"; then
27 +  # Cross-compiling from Linux for BeOS
28 +  CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer -fno-expensive-optimizations"
29 +  SHFLAGS=-nostart
30 +  audio_oss="no"
31 +  v4l="no"
32 +  dv1394="no"
33 +  netserver="yes"
34 +  need_inet_aton="yes"
35 +  extralibs="-lnet"
36 +fi
37 +
38  if test -z "$cross_prefix" ; then
39  
40  # ---
41 @@ -858,6 +870,9 @@
42  EOF
43  
44  have_lrintf="no"
45 +# BeOS doesn't have lrintf, make sure it is not enabled when
46 +# cross-compiling
47 +if test "${cross_prefix}" != "i586-pc-beos-"; then
48  if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
49    have_lrintf="yes"
50    # allanc@chickenandporn.com: cannot execute cross-compiled
51 @@ -866,6 +881,7 @@
52      $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
53    fi
54  fi
55 +fi
56  
57  _restrict=
58  for restrict_keyword in restrict __restrict__ __restrict; do
59 diff -ru ffmpeg-orig/libavcodec/eval.c ffmpeg/libavcodec/eval.c
60 --- ffmpeg-orig/libavcodec/eval.c       2005-01-17 19:25:32.000000000 +0100
61 +++ ffmpeg/libavcodec/eval.c    2005-03-01 00:27:04.000000000 +0100
62 @@ -34,6 +34,8 @@
63  #include <string.h>
64  #include <math.h>
65  
66 +/* Meuuh power */
67 +#undef NAN
68  #ifndef NAN
69    #define NAN 0
70  #endif
71 diff -ru ffmpeg-orig/libavformat/tcp.c ffmpeg/libavformat/tcp.c
72 --- ffmpeg-orig/libavformat/tcp.c       2005-02-24 20:08:50.000000000 +0100
73 +++ ffmpeg/libavformat/tcp.c    2005-03-01 00:27:04.000000000 +0100
74 @@ -32,6 +32,7 @@
75  #include <netdb.h>
76  #include <sys/time.h>
77  #include <fcntl.h>
78 +#define socklen_t int
79  
80  typedef struct TCPContext {
81      int fd;
82 @@ -112,11 +113,13 @@
83                  break;
84          }
85          
86 +#ifndef __BEOS__
87          /* test error */
88          optlen = sizeof(ret);
89          getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
90          if (ret != 0)
91              goto fail;
92 +#endif
93      }
94      s->fd = fd;
95      return 0;