[FFmpeg-devel] [PATCH] Fix compilation on OpenBSD
Mon Nov 17 22:25:14 CET 2008
Andrew Savchenko <bircoph at gmail.com> writes:
> the following patch allows to compile libavcodec on OpenBSD-4.2.
> This allows to compile MPlayer on this system. The problem is that
> there is no #define INFINITY in OpenBSD, but HUGE_VAL is.
> (However, I can't test FFmpeg itself outside
> libavcodec/libavformat/libavutil/libpostproc due to the following.
> The latest gmake in ports for this version of OpenBSD is
> gmake-3.80, and it dies with the following:
> $ gmake
> gmake: *** virtual memory exhausted. Stop.
> Afaik, this is fixed in recent gnu make version.
Yes, it is fixed in gnu make 3.81.
> But I'm not a system owner and I'm not allowed to install this kind
> of software outside of main ports tree.)
How can anyone live under such conditions?
> Index: libavcodec/nellymoserenc.c
> --- libavcodec/nellymoserenc.c (revision 15864)
> +++ libavcodec/nellymoserenc.c (working copy)
> @@ -45,6 +45,10 @@
> #define POW_TABLE_SIZE (1<<11)
> #define POW_TABLE_OFFSET 3
> +#if !defined(INFINITY) && defined(HUGE_VAL)
> +#define INFINITY HUGE_VAL
1. INFINITY is as standard as HUGE_VAL, so anywhere you find one, you
should have the other. If your system headers only define one of
them, it is these which should be fixed, not FFmpeg.
2. HUGE_VAL is of type double, whereas INFINITY is of type float.
Using HUGE_VAL where a float is expected might not work as
3. Aside from the above, this is the wrong place to add a missing
definition of INFINITY.
mans at mansr.com
More information about the ffmpeg-devel