Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2016 08:52:34 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r428400 - in head/graphics/php5-ffmpeg: . files
Message-ID:  <201612120852.uBC8qYBl030894@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Mon Dec 12 08:52:33 2016
New Revision: 428400
URL: https://svnweb.freebsd.org/changeset/ports/428400

Log:
  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

Modified:
  head/graphics/php5-ffmpeg/Makefile   (contents, props changed)
  head/graphics/php5-ffmpeg/files/patch-ffmpeg_frame.c   (contents, props changed)
  head/graphics/php5-ffmpeg/files/patch-ffmpeg_movie.c   (contents, props changed)

Modified: head/graphics/php5-ffmpeg/Makefile
==============================================================================
--- head/graphics/php5-ffmpeg/Makefile	Mon Dec 12 08:24:05 2016	(r428399)
+++ head/graphics/php5-ffmpeg/Makefile	Mon Dec 12 08:52:33 2016	(r428400)
@@ -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-

Modified: head/graphics/php5-ffmpeg/files/patch-ffmpeg_frame.c
==============================================================================
--- head/graphics/php5-ffmpeg/files/patch-ffmpeg_frame.c	Mon Dec 12 08:24:05 2016	(r428399)
+++ head/graphics/php5-ffmpeg/files/patch-ffmpeg_frame.c	Mon Dec 12 08:52:33 2016	(r428400)
@@ -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);
  

Modified: head/graphics/php5-ffmpeg/files/patch-ffmpeg_movie.c
==============================================================================
--- head/graphics/php5-ffmpeg/files/patch-ffmpeg_movie.c	Mon Dec 12 08:24:05 2016	(r428399)
+++ head/graphics/php5-ffmpeg/files/patch-ffmpeg_movie.c	Mon Dec 12 08:52:33 2016	(r428400)
@@ -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);
+  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612120852.uBC8qYBl030894>