Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 May 2018 19:20:28 +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: r468978 - in head/audio/idjc: . files
Message-ID:  <201805031920.w43JKSmd060116@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Thu May  3 19:20:28 2018
New Revision: 468978
URL: https://svnweb.freebsd.org/changeset/ports/468978

Log:
  audio/idjc: unbreak with ffmpeg 4.0
  
  avcodec_encoder.c:118:78: error: 'FF_INPUT_BUFFER_PADDING_SIZE' undeclared (first use in this function)
           if (posix_memalign((void *)&s->inbuf, BYTE_ALIGNMENT, s->inbufsize + FF_INPUT_BUFFER_PADDING_SIZE)) {
                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  avcodec_encoder.c:125:68: error: 'FF_MIN_BUFFER_SIZE' undeclared (first use in this function)
           if (posix_memalign((void *)&s->avpkt.data, BYTE_ALIGNMENT, FF_MIN_BUFFER_SIZE)) {
                                                                      ^~~~~~~~~~~~~~~~~~
  avcodec_encoder.c:199:52: error: 'CODEC_CAP_DELAY' undeclared (first use in this function)
               if (final && (s->codec->capabilities | CODEC_CAP_DELAY)) {
                                                      ^~~~~~~~~~~~~~~
  avcodec_encoder.c:212:71: error: 'CODEC_CAP_VARIABLE_FRAME_SIZE' undeclared (first use in this function)
               if (!final || s->codec->capabilities & (CODEC_CAP_DELAY | CODEC_CAP_VARIABLE_FRAME_SIZE | CODEC_CAP_SMALL_LAST_FRAME)) {
                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  avcodec_encoder.c:212:103: error: 'CODEC_CAP_SMALL_LAST_FRAME' undeclared (first use in this function)
               if (!final || s->codec->capabilities & (CODEC_CAP_DELAY | CODEC_CAP_VARIABLE_FRAME_SIZE | CODEC_CAP_SMALL_LAST_FRAME)) {
                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
  
  PR:		227726
  Reported by:	antoine (via exp-run)

Added:
  head/audio/idjc/files/
  head/audio/idjc/files/patch-c_avcodec__encoder.c   (contents, props changed)
Modified:
  head/audio/idjc/Makefile   (contents, props changed)

Modified: head/audio/idjc/Makefile
==============================================================================
--- head/audio/idjc/Makefile	Thu May  3 19:08:50 2018	(r468977)
+++ head/audio/idjc/Makefile	Thu May  3 19:20:28 2018	(r468978)
@@ -12,8 +12,6 @@ COMMENT=	Shoutcast/Icecast DJ Console
 
 LICENSE=	LGPL20
 
-BROKEN=		fails to build with ffmpeg 4.0
-
 LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg \
 		libavutil.so:multimedia/ffmpeg \
 		libjack.so:audio/jack \

Added: head/audio/idjc/files/patch-c_avcodec__encoder.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/idjc/files/patch-c_avcodec__encoder.c	Thu May  3 19:20:28 2018	(r468978)
@@ -0,0 +1,70 @@
+Removed in 0.8.17, see https://sourceforge.net/p/idjc/code/ci/7ca28dc311b4/
+
+--- c/avcodec_encoder.c.orig	2016-02-27 13:24:52 UTC
++++ c/avcodec_encoder.c
+@@ -34,6 +34,21 @@
+ #ifndef HAVE_AV_FRAME_UNREF
+ #define av_frame_unref avcodec_get_frame_defaults
+ #endif
++#ifndef AV_INPUT_BUFFER_PADDING_SIZE
++#define AV_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
++#endif
++#ifndef AV_INPUT_BUFFER_MIN_SIZE
++#define AV_INPUT_BUFFER_MIN_SIZE FF_MIN_BUFFER_SIZE
++#endif
++#ifndef AV_CODEC_CAP_DELAY
++#define AV_CODEC_CAP_DELAY CODEC_CAP_DELAY
++#endif
++#ifndef AV_CODEC_CAP_SMALL_LAST_FRAME
++#define AV_CODEC_CAP_SMALL_LAST_FRAME CODEC_CAP_SMALL_LAST_FRAME
++#endif
++#ifndef AV_CODEC_CAP_VARIABLE_FRAME_SIZE
++#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE CODEC_CAP_VARIABLE_FRAME_SIZE
++#endif
+ 
+ #define BYTE_ALIGNMENT (8)
+ 
+@@ -115,14 +130,14 @@ static void live_avcodec_encoder_main(struct encoder *
+ 
+         // allocate the input buffer
+         s->inbufsize = c->frame_size * c->channels * av_get_bytes_per_sample(c->sample_fmt);
+-        if (posix_memalign((void *)&s->inbuf, BYTE_ALIGNMENT, s->inbufsize + FF_INPUT_BUFFER_PADDING_SIZE)) {
++        if (posix_memalign((void *)&s->inbuf, BYTE_ALIGNMENT, s->inbufsize + AV_INPUT_BUFFER_PADDING_SIZE)) {
+             fprintf(stderr, "live_avcodec_encoder_main: malloc failure\n");
+             goto bailout;
+         }
+-        memset(s->inbuf + s->inbufsize, '\0', FF_INPUT_BUFFER_PADDING_SIZE); 
++        memset(s->inbuf + s->inbufsize, '\0', AV_INPUT_BUFFER_PADDING_SIZE); 
+         
+         // allocate the output buffer
+-        if (posix_memalign((void *)&s->avpkt.data, BYTE_ALIGNMENT, FF_MIN_BUFFER_SIZE)) {
++        if (posix_memalign((void *)&s->avpkt.data, BYTE_ALIGNMENT, AV_INPUT_BUFFER_MIN_SIZE)) {
+             fprintf(stderr, "live_avcodec_encoder_main: malloc failure\n");  
+             goto bailout;
+         }
+@@ -192,11 +207,11 @@ static void live_avcodec_encoder_main(struct encoder *
+ 
+                 encoder_ip_data_free(id);
+             } else {
+-                memset(s->inbuf, '\0', FF_INPUT_BUFFER_PADDING_SIZE);
++                memset(s->inbuf, '\0', AV_INPUT_BUFFER_PADDING_SIZE);
+                 s->pkt_flags |= PF_FINAL;
+             }
+ 
+-            if (final && (s->codec->capabilities | CODEC_CAP_DELAY)) {
++            if (final && (s->codec->capabilities | AV_CODEC_CAP_DELAY)) {
+                 av_free(s->decoded_frame);
+                 s->decoded_frame = NULL;
+             } else {
+@@ -209,9 +224,9 @@ static void live_avcodec_encoder_main(struct encoder *
+                 }
+             }
+             
+-            if (!final || s->codec->capabilities & (CODEC_CAP_DELAY | CODEC_CAP_VARIABLE_FRAME_SIZE | CODEC_CAP_SMALL_LAST_FRAME)) {
++            if (!final || s->codec->capabilities & (AV_CODEC_CAP_DELAY | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | AV_CODEC_CAP_SMALL_LAST_FRAME)) {
+                 // decode as much data is this encoder wants to
+-                s->avpkt.size = FF_MIN_BUFFER_SIZE;
++                s->avpkt.size = AV_INPUT_BUFFER_MIN_SIZE;
+                 if (avcodec_encode_audio2(c, &s->avpkt, s->decoded_frame, &got_packet) < 0) {
+                     fprintf(stderr, "avcodec_encoder_main: encoding failed\n");
+                     encoder->encoder_state = ES_STOPPING;



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