Web lists-archives.com

[MPlayer-dev-eng] [PATCH] libvpx compilation failure

 compilation fails on Debian stable because of libvpx

r@blacktower:/usr/local/src/mplayer$ make
./version.sh `cc -dumpversion`
make -C ffmpeg libavcodec/libavcodec.a
make[1]: Entering directory `/usr/local/src/mplayer/ffmpeg'
CC	libavcodec/libvpxdec.o
libavcodec/libvpxdec.c: In function 'set_pix_fmt':
libavcodec/libvpxdec.c:71:14: error: 'VPX_IMG_FMT_I422' undeclared
(first use in this function) libavcodec/libvpxdec.c:71:14: note: each
undeclared identifier is reported only once for each function it
appears in libavcodec/libvpxdec.c:74:14: error: 'VPX_IMG_FMT_I444'
undeclared (first use in this function) make[1]: ***
[libavcodec/libvpxdec.o] Error 1 make[1]: Leaving directory
`/usr/local/src/mplayer/ffmpeg' make: ***
[ffmpeg/libavcodec/libavcodec.a] Error 2

libvpxdec.c uses some symbols that exist only in the vp9 codec,
while the libvpx included in debian stable (v 1.1.0) is vp8-only.
MPlayer fails to detect this, and tries to compile it anyway; FFmpeg
correctly disables libvpx on my system.

The attached patch fixes it.
It syncs our libvpx detection with FFmpeg, and so disables libvpx
compilation if vp9 is not there.

This could also be a bug in FFmpeg, since it should not use vp9 symbols
if vp9 decoder is not enabled. From what I understand FFmpeg configure
disables libvpx if any of the checks fails (vp8dec, vp8enc, vp9dec,
vp9enc), so I'm not so sure that I can call it a bug.

Can someone with a recent libvpx please check that detection works?

I'll apply it when somebody can confirm it works with a good libvpx
(or when Debian releases the next stable, whatever comes first).

Index: configure
--- configure	(revisione 37285)
+++ configure	(copia locale)
@@ -7412,11 +7412,12 @@
 #include <vpx/vpx_decoder.h>
 #include <vpx/vp8dx.h>
 #include <vpx/vp8cx.h>
-struct vpx_codec_ctx decoder;
 int main(void) {
-  vpx_codec_dec_init(NULL, &vpx_codec_vp8_dx_algo, NULL, 0);
-  vpx_codec_enc_init(NULL, &vpx_codec_vp8_dx_algo, NULL, 0);
-  return VPX_CQ;
+  (long)vpx_codec_dec_init_ver +
+  (long)vpx_codec_enc_init_ver +
+  (long)vpx_codec_vp9_dx +
+  (long)vpx_codec_vp9_cx;
     cc_check -lvpx && _libvpx_lavc=yes && extra_ldflags="$extra_ldflags -lvpx"
MPlayer-dev-eng mailing list