[MPlayer-dev-eng] Allow compilation with Libav

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Jan 2 17:29:01 CET 2012


On 2 Jan 2012, at 00:22, Reinhard Tartler <siretart at tauware.de> wrote:
> In order to build mplayer against Libav, a couple of minor patches are
> necessary. I've developed them in the course of maintaining the daily
> builds at https://launchpad.net/~motumedia/+archive/mplayer-daily/, but
> as compatibility with Libav is a requirement for the distro mplayer
> package in debian, I feel they should better go to svn properly.
> 
> So here we go:
> 
> --- mplayer-1.0~svn34481.orig/fmt-conversion.c
> +++ mplayer-1.0~svn34481/fmt-conversion.c
> @@ -24,6 +24,11 @@
> #include "libaf/af_format.h"
> #include "fmt-conversion.h"
> 
> +// libav.org's libavutil is missing this
> +#ifndef PIX_FMT_GBR24P
> +#define PIX_FMT_GBR24P PIX_FMT_GBRP
> +#endif
> +
> static const struct {
>     int fmt;
>     enum PixelFormat pix_fmt;
> @@ -57,7 +62,9 @@
>     {IMGFMT_RGB8,    PIX_FMT_BGR8},
>     {IMGFMT_RGB4,    PIX_FMT_BGR4},
>     {IMGFMT_BGR8,    PIX_FMT_PAL8},
> +#ifdef PIX_FMT_0RGB32
>     {IMGFMT_BGR32,   PIX_FMT_0RGB32},
> +#endif
> #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1)
>     {IMGFMT_GBR24P,  PIX_FMT_GBR24P},
> #endif
> 
> I think these hunks should be rather safe. Instead of using
> PIX_FMT_GBR24P, we could also use PIX_FMT_GBRP directly, as this #define
> was copied FFmpeg's libavcodec.
> 
> --- mplayer-1.0~svn34481.orig/libmpdemux/mp_taglists.c
> +++ mplayer-1.0~svn34481/libmpdemux/mp_taglists.c
> @@ -43,7 +43,9 @@
>     { CODEC_ID_COOK,              MKTAG('c', 'o', 'o', 'k')},
>     { CODEC_ID_DSICINAUDIO,       MKTAG('D', 'C', 'I', 'A')},
>     { CODEC_ID_EAC3,              MKTAG('E', 'A', 'C', '3')},
> +#ifdef CODEC_ID_FFWAVESYNTH
>     { CODEC_ID_FFWAVESYNTH,       MKTAG('F', 'F', 'W', 'S')},
> +#endif
>     { CODEC_ID_G723_1,            MKTAG('7', '2', '3', '1')},
>     { CODEC_ID_INTERPLAY_DPCM,    MKTAG('I', 'N', 'P', 'A')},
>     { CODEC_ID_MLP,               MKTAG('M', 'L', 'P', ' ')},
> @@ -85,7 +87,9 @@
>     { CODEC_ID_DVVIDEO,           MKTAG('d', 'v', 's', 'd')},
>     { CODEC_ID_EAC3,              MKTAG('E', 'A', 'C', '3')},
>     { CODEC_ID_ESCAPE124,         MKTAG('E', '1', '2', '4')},
> +#ifdef CODEC_ID_ESCAPE130
>     { CODEC_ID_ESCAPE130,         MKTAG('E', '1', '3', '0')},
> +#endif
>     { CODEC_ID_FLV1,              MKTAG('F', 'L', 'V', '1')},
>     { CODEC_ID_G729,              MKTAG('G', '7', '2', '9')},
>     { CODEC_ID_H264,              MKTAG('H', '2', '6', '4')},
> 
> These codec id's do not exist in Libav's libavcodec.
> 
> Actually, there used to be a couple of more patches in the daily builds,
> but I think they are no longer necessary. In case I'm wrong, I'll sent
> another email with those included. The patches above, however, are
> definitly necessary.
> 
> Please tell me which of the above changes are acceptable and what
> additional work the other ones require to become acceptable.

I'll have to check up on it, but I don't think any of these can work, those are not defines but enums only to my knowledge, so the whole ifndef stuff shouldn't work one bit.


More information about the MPlayer-dev-eng mailing list