mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-23 09:10:43 +00:00
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)
This commit is contained in:
parent
c585c766f3
commit
64b6be4966
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=468978
@ -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 \
|
||||
|
70
audio/idjc/files/patch-c_avcodec__encoder.c
Normal file
70
audio/idjc/files/patch-c_avcodec__encoder.c
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user