Hello, I would like to present a patch which will help build 'php5-ffmpeg' against libav-0.9, after passing a hurdle which is not handled by the patch.
The hurdle is that 'libavutil-dev' has the header file 'time.h': $ apt-file search libavutil/time.h libavutil-dev: /usr/include/libavutil/time.h [...] The include path /usr/include/libavutil is added when the build scripts configure ffmpeg-php, so the "<time.h>" references in various system libraries get pointed to the _wrong_ time.h. The workaround I came up with (because I did not come up with a proper solution) was to add: #include "/usr/include/time.h" into /usr/include/libavutil/time.h If the wrong time.h is read, as is the case for the first issue of this FTBFS, several declarations of structs such as 'time_t' are missing. The attached patch fixes the problems which occur _after_ the time.h issue is fixed. The patch is designed to be put into the 'debian/patches' directory and added last in the 'debian/patches/series' file. I don't currently know much more on how to package patches for Debian projects :) While this makes it build alright, there is some kind of problem remaining. I get bad frame counts on the getFrameCount() call (45888 frames instead of something like 190), while referencing frames with getFrame(n) still fetches properly, in my test case the last fetchable frame being 188. So if someone else could please have a look at how to make it build with the colliding libavutil/time.h we're soon able to have this package back in the repositories :)
Description: Fix FTBFS with libav 0.9 caused by deprecated functions. Author: Mikael Nordfeldth <m...@hethane.se> --- a/ffmpeg_movie.c 2014-04-28 22:35:14.127769532 +0200 +++ b/ffmpeg_movie.c 2014-04-28 22:08:24.570369931 +0200 @@ -259,12 +259,12 @@ } /* open the file with generic libav function */ - if (av_open_input_file(&ffmovie_ctx->fmt_ctx, filename, NULL, 0, NULL) < 0) { + if (avformat_open_input(&ffmovie_ctx->fmt_ctx, filename, NULL, NULL) < 0) { return 1; } /* decode the first frames to get the stream parameters. */ - av_find_stream_info(ffmovie_ctx->fmt_ctx); + avformat_find_stream_info(ffmovie_ctx->fmt_ctx, NULL); return 0; } @@ -514,7 +514,7 @@ GET_CODEC_PTR(ffmovie_ctx->fmt_ctx->streams[stream_index]->codec); /* open the decoder */ - if (avcodec_open(ffmovie_ctx->codec_ctx[stream_index], decoder) < 0) { + if (avcodec_open2(ffmovie_ctx->codec_ctx[stream_index], decoder, NULL) < 0) { zend_error(E_WARNING, "Could not open codec for %s", _php_get_filename(ffmovie_ctx)); return NULL; } @@ -869,7 +869,7 @@ GET_MOVIE_RESOURCE(ffmovie_ctx); pix_fmt = _php_get_pixelformat(ffmovie_ctx); - fmt = avcodec_get_pix_fmt_name(pix_fmt); + fmt = av_get_pix_fmt_name(pix_fmt); if (fmt) { /* cast const to non-const to keep compiler from complaining, --- a/ffmpeg-php.c 2008-10-13 21:00:08.000000000 +0200 +++ b/ffmpeg-php.c 2014-04-28 21:54:40.603741524 +0200 @@ -90,9 +90,6 @@ */ PHP_MINIT_FUNCTION(ffmpeg) { - /* must be called before using avcodec libraries. */ - avcodec_init(); - /* register all codecs */ av_register_all();
signature.asc
Description: This is a digitally signed message part