cmus: patch for ffmpeg-4.0.1.

This commit is contained in:
Johannes Brechtmann 2018-05-09 22:03:16 +02:00 committed by Jürgen Buchmüller
parent cd96f0eba3
commit f1f6a57950
2 changed files with 20 additions and 23 deletions

View file

@ -1,18 +1,5 @@
https://trac.macports.org/ticket/51212 --- ffmpeg.c.orig 2018-05-09 21:56:02.949627655 +0200
+++ ffmpeg.c 2018-05-09 21:58:59.749022102 +0200
--- configure.orig 2015-07-13 03:00:56.000000000 -0700
+++ configure 2016-04-22 15:22:53.000000000 -0700
@@ -387,7 +387,7 @@
fi
# ffmpeg api changes so frequently that it is best to compile the module
libs="$LDDLFLAGS $FFMPEG_LIBS"
- cflags="$SOFLAGS $FFMPEG_CFLAGS"
+ cflags="-std=gnu99 $SOFLAGS $FFMPEG_CFLAGS"
if test "$HAVE_FFMPEG_AVCODEC_H" = y
then
cflags="$cflags -DHAVE_FFMPEG_AVCODEC_H"
--- ffmpeg.c.orig 2015-07-13 03:00:56.000000000 -0700
+++ ffmpeg.c 2016-04-22 15:22:53.000000000 -0700
@@ -39,7 +39,11 @@ @@ -39,7 +39,11 @@
#include <libavformat/avio.h> #include <libavformat/avio.h>
#include <libswresample/swresample.h> #include <libswresample/swresample.h>
@ -37,7 +24,7 @@ https://trac.macports.org/ticket/51212
free(input); free(input);
} }
@@ -235,7 +243,11 @@ @@ -235,20 +243,33 @@
codec = avcodec_find_decoder(cc->codec_id); codec = avcodec_find_decoder(cc->codec_id);
if (!codec) { if (!codec) {
@ -49,7 +36,17 @@ https://trac.macports.org/ticket/51212
err = -IP_ERROR_UNSUPPORTED_FILE_TYPE; err = -IP_ERROR_UNSUPPORTED_FILE_TYPE;
break; break;
} }
@@ -248,7 +260,11 @@
+#if LIBAVCODEC_VERSION_MAJOR >= 58
+ if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
+ cc->flags |= AV_CODEC_FLAG_TRUNCATED;
+#else
if (codec->capabilities & CODEC_CAP_TRUNCATED)
cc->flags |= CODEC_FLAG_TRUNCATED;
+#endif
#if (LIBAVCODEC_VERSION_INT < ((53<<16)+(8<<8)+0))
if (avcodec_open(cc, codec) < 0) {
#else #else
if (avcodec_open2(cc, codec, NULL) < 0) { if (avcodec_open2(cc, codec, NULL) < 0) {
#endif #endif
@ -61,7 +58,7 @@ https://trac.macports.org/ticket/51212
err = -IP_ERROR_UNSUPPORTED_FILE_TYPE; err = -IP_ERROR_UNSUPPORTED_FILE_TYPE;
break; break;
} }
@@ -347,7 +363,11 @@ @@ -347,7 +368,11 @@
struct ffmpeg_output *output, SwrContext *swr) struct ffmpeg_output *output, SwrContext *swr)
{ {
#if (LIBAVCODEC_VERSION_INT >= ((53<<16) + (25<<8) + 0)) #if (LIBAVCODEC_VERSION_INT >= ((53<<16) + (25<<8) + 0))
@ -73,7 +70,7 @@ https://trac.macports.org/ticket/51212
int got_frame; int got_frame;
#endif #endif
while (1) { while (1) {
@@ -359,10 +379,16 @@ @@ -359,10 +384,16 @@
int len; int len;
if (input->curr_pkt_size <= 0) { if (input->curr_pkt_size <= 0) {
@ -91,7 +88,7 @@ https://trac.macports.org/ticket/51212
avcodec_free_frame(&frame); avcodec_free_frame(&frame);
#endif #endif
return 0; return 0;
@@ -399,7 +425,11 @@ @@ -399,7 +430,11 @@
av_new_packet(&avpkt, input->curr_pkt_size); av_new_packet(&avpkt, input->curr_pkt_size);
memcpy(avpkt.data, input->curr_pkt_buf, input->curr_pkt_size); memcpy(avpkt.data, input->curr_pkt_buf, input->curr_pkt_size);
len = avcodec_decode_audio4(cc, frame, &got_frame, &avpkt); len = avcodec_decode_audio4(cc, frame, &got_frame, &avpkt);
@ -103,7 +100,7 @@ https://trac.macports.org/ticket/51212
} }
#endif #endif
if (len < 0) { if (len < 0) {
@@ -426,7 +456,11 @@ @@ -426,7 +461,11 @@
res = 0; res = 0;
output->buffer_pos = output->buffer; output->buffer_pos = output->buffer;
output->buffer_used_len = res * cc->channels * sizeof(int16_t); output->buffer_used_len = res * cc->channels * sizeof(int16_t);
@ -115,7 +112,7 @@ https://trac.macports.org/ticket/51212
return output->buffer_used_len; return output->buffer_used_len;
} }
#endif #endif
@@ -566,7 +600,11 @@ @@ -566,7 +605,11 @@
long bitrate = -1; long bitrate = -1;
#if (LIBAVFORMAT_VERSION_INT > ((51<<16)+(43<<8)+0)) #if (LIBAVFORMAT_VERSION_INT > ((51<<16)+(43<<8)+0))
/* ape codec returns silly numbers */ /* ape codec returns silly numbers */

View file

@ -1,7 +1,7 @@
# Template file for 'cmus' # Template file for 'cmus'
pkgname=cmus pkgname=cmus
version=2.7.1 version=2.7.1
revision=4 revision=5
hostmakedepends="pkg-config" hostmakedepends="pkg-config"
makedepends="ncurses-devel faad2-devel libflac-devel libao-devel libmad-devel makedepends="ncurses-devel faad2-devel libflac-devel libao-devel libmad-devel
libmodplug-devel libmp4v2-devel libmpcdec-devel pulseaudio-devel libmodplug-devel libmp4v2-devel libmpcdec-devel pulseaudio-devel