graphics/php5-ffmpeg: unbreak runtime with ffmpeg 3.x

$ echo CFLAGS+=-Werror=implicit-function-declaration >>Makefile.local
$ make
[...]
ffmpeg_movie.c:1228:13:error: implicit declaration of function 'avcodec_alloc_frame' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    frame = avcodec_alloc_frame();
            ^
PR:		214191
Pointy hat to:	jbeich
Approved by:	portmgr blanket
This commit is contained in:
Jan Beich 2016-12-12 08:52:33 +00:00
parent 4b61234a3d
commit e5742228cf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=428400
3 changed files with 41 additions and 3 deletions

View file

@ -4,7 +4,7 @@
PORTNAME= ffmpeg
PORTVERSION= 0.6.0.20120114
DISTVERSIONPREFIX= php-
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= graphics
MASTER_SITES= LOCAL/sunpoet
PKGNAMEPREFIX= php5-

View file

@ -1,5 +1,23 @@
--- ffmpeg_frame.c.orig 2014-07-23 17:57:32 UTC
+++ ffmpeg_frame.c
@@ -211,7 +211,7 @@ int _php_convert_frame(ff_frame_context
return 0; // NOP
}
- dst_frame = avcodec_alloc_frame();
+ dst_frame = av_frame_alloc();
avpicture_alloc((AVPicture*)dst_frame, dst_fmt, ff_frame->width,
ff_frame->height);
@@ -400,7 +400,7 @@ FFMPEG_PHP_METHOD(ffmpeg_frame, ffmpeg_f
height = gdImageSY(gd_img);
/* create a an av_frame and allocate space for it */
- frame = avcodec_alloc_frame();
+ frame = av_frame_alloc();
avpicture_alloc((AVPicture*)frame, FFMPEG_PHP_FFMPEG_RGB_PIX_FORMAT, width, height);
/* copy the gd image to the av_frame */
@@ -499,7 +499,7 @@ int _php_resample_frame(ff_frame_context
}
@ -9,11 +27,13 @@
img_resample_ctx = img_resample_full_init(
wanted_width, wanted_height,
@@ -511,7 +511,7 @@ int _php_resample_frame(ff_frame_context
@@ -510,8 +510,8 @@ int _php_resample_frame(ff_frame_context
return -1;
}
resampled_frame = avcodec_alloc_frame();
- resampled_frame = avcodec_alloc_frame();
- avpicture_alloc((AVPicture*)resampled_frame, PIX_FMT_YUV420P,
+ resampled_frame = av_frame_alloc();
+ avpicture_alloc((AVPicture*)resampled_frame, AV_PIX_FMT_YUV420P,
wanted_width, wanted_height);

View file

@ -53,3 +53,21 @@
/* fake mpeg2 transport stream codec (currently not registered) */
codec_name = "mpeg2ts";
} else if (decoder_ctx->codec_name[0] != '\0') {
@@ -1223,7 +1225,7 @@ static AVFrame* _php_read_av_frame(ff_mo
return NULL;
}
- frame = avcodec_alloc_frame();
+ frame = av_frame_alloc();
/* read next frame */
while (av_read_frame(ffmovie_ctx->fmt_ctx, &packet) >= 0) {
@@ -1353,7 +1355,7 @@ static int _php_get_ff_frame(ff_movie_co
ff_frame->keyframe = is_keyframe;
ff_frame->pts = pts;
- ff_frame->av_frame = avcodec_alloc_frame();
+ ff_frame->av_frame = av_frame_alloc();
avpicture_alloc((AVPicture*)ff_frame->av_frame, ff_frame->pixel_format,
ff_frame->width, ff_frame->height);