[MPlayer-cvslog] r34492 - in trunk: fmt-conversion.c libmpdemux/mp_taglists.c
Reinhard Tartler
siretart at tauware.de
Tue Jan 3 17:13:34 CET 2012
On Di, Jan 03, 2012 at 16:51:26 (CET), siretart wrote:
> Author: siretart
> Date: Tue Jan 3 16:51:26 2012
> New Revision: 34492
>
> Log:
> Allow compilation with Libav
>
> Some CPP Macros and codec ids are not (yet) available in libav, so use
> them only if they are actually defined. This doesn't work for code ids,
> as they are defined as enums. Therefore, #ifdefs tests for the presence
> of the respective codec.
>
> This approach should also allow to compile mplayer against earlier
> versions of FFmpeg.
Just for completeness, this patch would restore compilation with FFmpeg 0.8:
Index: libmpcodecs/ad_spdif.c
===================================================================
--- libmpcodecs/ad_spdif.c (revision 34491)
+++ libmpcodecs/ad_spdif.c (working copy)
@@ -118,7 +118,11 @@
read_packet, write_packet, seek);
if (!lavf_ctx->pb)
goto fail;
+#if LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR > 8
stream = avformat_new_stream(lavf_ctx, 0);
+#else
+ stream = av_new_stream(lavf_ctx, 0);
+#endif
if (!stream)
goto fail;
lavf_ctx->duration = AV_NOPTS_VALUE;
Index: fmt-conversion.c
===================================================================
--- fmt-conversion.c (revision 34491)
+++ fmt-conversion.c (working copy)
@@ -57,9 +57,11 @@
{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},
+ {IMGFMT_GBR24P, PIX_FMT_GBRP},
#endif
{IMGFMT_YUY2, PIX_FMT_YUYV422},
{IMGFMT_UYVY, PIX_FMT_UYVY422},
Index: libmpdemux/mp_taglists.c
===================================================================
--- libmpdemux/mp_taglists.c (revision 34491)
+++ libmpdemux/mp_taglists.c (working copy)
@@ -39,12 +39,18 @@
{ CODEC_ID_AMR_NB, MKTAG('n', 'b', 0, 0)},
{ CODEC_ID_BINKAUDIO_DCT, MKTAG('B', 'A', 'U', '1')},
{ CODEC_ID_BINKAUDIO_RDFT, MKTAG('B', 'A', 'U', '2')},
+#ifdef CONFIG_BMV_AUDIO_DECODER
{ CODEC_ID_BMV_AUDIO, MKTAG('B', 'M', 'V', 'A')},
+#endif
{ 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 CONFIG_FFWAVESYNTH_DECODER
{ CODEC_ID_FFWAVESYNTH, MKTAG('F', 'F', 'W', 'S')},
+#endif
+#if LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR > 8
{ CODEC_ID_G723_1, MKTAG('7', '2', '3', '1')},
+#endif
{ CODEC_ID_INTERPLAY_DPCM, MKTAG('I', 'N', 'P', 'A')},
{ CODEC_ID_MLP, MKTAG('M', 'L', 'P', ' ')},
{ CODEC_ID_MP1, 0x50},
@@ -85,9 +91,13 @@
{ 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 CONFIG_ESCAPE130_DECODER
{ CODEC_ID_ESCAPE130, MKTAG('E', '1', '3', '0')},
+#endif
{ CODEC_ID_FLV1, MKTAG('F', 'L', 'V', '1')},
+#if LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR > 8
{ CODEC_ID_G729, MKTAG('G', '7', '2', '9')},
+#endif
{ CODEC_ID_H264, MKTAG('H', '2', '6', '4')},
{ CODEC_ID_MP3, 0x55},
{ CODEC_ID_MPEG4, MKTAG('M', 'P', '4', 'V')},
@@ -116,7 +126,9 @@
{ CODEC_ID_AVS, MKTAG('A', 'V', 'S', ' ')},
{ CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')},
{ CODEC_ID_BFI, MKTAG('B', 'F', 'I', 'V')},
+#ifdef CONFIG_BMV_VIDEO_DECODER
{ CODEC_ID_BMV_VIDEO, MKTAG('B', 'M', 'V', 'V')},
+#endif
{ CODEC_ID_C93, MKTAG('C', '9', '3', 'V')},
{ CODEC_ID_CDGRAPHICS, MKTAG('C', 'D', 'G', 'R')},
{ CODEC_ID_CMV, MKTAG('M', 'V', 'I', 'f')},
Not pretty, but could be far worse.
The configure script and Makefile still need changes, though. Currently,
it stops compilation with this errors:
make[1]: Entering directory `/build/tartler/mplayer-trunk/ffmpeg'
Makefile:239: /tests/fate.mak: No such file or directory
Makefile:240: /tests/fate2.mak: No such file or directory
[...]
No idea what's about them, though.
Cheers,
Reinhard
--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4
More information about the MPlayer-cvslog
mailing list