Hi,
current gnash fails to detect ffmpeg headers if ffmpeg is patched with support
for the Dirac codec.
The problem is that Dirac makes ffmpeg #include some dirac headers, and
therefore adjusts the pkgconfig file to include both the ffmpeg and dirac
includes -- the ffmpeg detection code in macros/ffmpeg.m4 assumes
pkg-config --cflags-only-I libavcodec prints only 1 path. (future ffmpeg
versions might print several paths as well, depending on what external
dependencies are added...).
There's also some more oddities in ffmpeg.m4:
if $PKG_CONFIG --exists libavcodec; then
[...]
fi
topdir=`$PKG_CONFIG --cflags-only-I libavcodec [...]`
topdir will be garbage if pkg-config --exists libavcodec failed (because there
is no pkgconfig file in that case), so that check should be moved inside the
if $PKGCONFIG --exists block.
The patch I've attached fixes both issues.
--- gnash/macros/ffmpeg.m4.ark 2007-07-09 13:51:42.000000000 +0200
+++ gnash/macros/ffmpeg.m4 2007-07-09 14:05:27.000000000 +0200
@@ -47,8 +47,23 @@
# Here pkg-config outputs two spaces on the end, so match those too!
ac_cv_path_ffmpeg_incl=`$PKG_CONFIG --cflags libavcodec | sed 's:/ffmpeg *$::'`
CFLAGS="$ac_cv_path_ffmpeg_incl $CFLAGS"
+ # ac_cv_path_ffmpeg_incl might include several paths (e.g. pointers to
+ # external libraries used by ffmpeg). Let's find the right one.
+ for i in `$PKG_CONFIG --cflags-only-I libavcodec |sed -e 's:-I::g'`; do
+ if test -e "$i"/avcodec.h -o -e "$i"/ffmpeg/avcodec.h; then
+ topdir="$i"
+ break
+ fi
+ done
+ else
+ # Let's see if ffmpeg is installed without using pkgconfig...
+ for i in /usr/include /usr/local/include /opt/ffmpeg/include; do
+ if test -e "$i"/ffmpeg/avcodec.h; then
+ topdir="$i"
+ break
+ fi
+ done
fi
- topdir=`$PKG_CONFIG --cflags-only-I libavcodec | sed -e 's:-I::g' -e 's:.* /:/:' -e 's: ::g'`
# Again adjust for ffmpeg/ foolery
topdir=`echo "$topdir" | sed 's:/ffmpeg *$::'`
# Gets "" if not installed
_______________________________________________
Gnash mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash