public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-sound/cmus/files/, media-sound/cmus/
@ 2019-03-20 12:29 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2019-03-20 12:29 UTC (permalink / raw
  To: gentoo-commits

commit:     7549e0ff4dec4ef6624a74bda69990abda1910c8
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 20 11:57:41 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 12:29:33 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7549e0ff

media-sound/cmus: Fix ffmpeg deprecations being future build errors

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 media-sound/cmus/cmus-2.8.0.ebuild                 |   5 +-
 .../files/cmus-2.8.0-ffmpeg-deprecations.patch     | 124 +++++++++++++++++++++
 2 files changed, 128 insertions(+), 1 deletion(-)

diff --git a/media-sound/cmus/cmus-2.8.0.ebuild b/media-sound/cmus/cmus-2.8.0.ebuild
index 27052411479..22dddaf4873 100644
--- a/media-sound/cmus/cmus-2.8.0.ebuild
+++ b/media-sound/cmus/cmus-2.8.0.ebuild
@@ -66,7 +66,10 @@ REQUIRED_USE="tremor? ( vorbis )
 
 DOCS=( AUTHORS README.md )
 
-PATCHES=( "${FILESDIR}/${P}-elogind.patch" )
+PATCHES=(
+	"${FILESDIR}/${P}-elogind.patch"
+	"${FILESDIR}/${P}-ffmpeg-deprecations.patch"
+)
 
 S="${WORKDIR}/${P/_/-}"
 

diff --git a/media-sound/cmus/files/cmus-2.8.0-ffmpeg-deprecations.patch b/media-sound/cmus/files/cmus-2.8.0-ffmpeg-deprecations.patch
new file mode 100644
index 00000000000..941f47e3d49
--- /dev/null
+++ b/media-sound/cmus/files/cmus-2.8.0-ffmpeg-deprecations.patch
@@ -0,0 +1,124 @@
+From 9877eb02381fd4c57059f9c77be03127c28d8f88 Mon Sep 17 00:00:00 2001
+From: Niko E <nefthy@users.noreply.github.com>
+Date: Mon, 11 Feb 2019 09:09:21 +0100
+Subject: [PATCH] Fixes ffmpeg deprecations (#861)
+
+- av_register_all is no longer needed since 4.0
+- AVStream::codec is deprecated since 3.1
+- avcodec_decode_audio4 is deprecated since 3.1
+---
+ ip/ffmpeg.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+diff --git a/ip/ffmpeg.c b/ip/ffmpeg.c
+index eaad5c4f..418a37f8 100644
+--- a/ip/ffmpeg.c
++++ b/ip/ffmpeg.c
+@@ -128,9 +128,11 @@ static void ffmpeg_init(void)
+ 
+ 	av_log_set_level(AV_LOG_QUIET);
+ 
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 18, 100)
+ 	/* We could register decoders explicitly to save memory, but we have to
+ 	 * be careful about compatibility. */
+ 	av_register_all();
++#endif
+ }
+ 
+ static int ffmpeg_open(struct input_plugin_data *ip_data)
+@@ -143,6 +145,9 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
+ 	AVCodec *codec;
+ 	AVCodecContext *cc = NULL;
+ 	AVFormatContext *ic = NULL;
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
++	AVCodecParameters *cp = NULL;
++#endif
+ 	SwrContext *swr = NULL;
+ 
+ 	ffmpeg_init();
+@@ -162,11 +167,20 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
+ 		}
+ 
+ 		for (i = 0; i < ic->nb_streams; i++) {
++
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
++			cp = ic->streams[i]->codecpar;
++			if (cp->codec_type == AVMEDIA_TYPE_AUDIO) {
++				stream_index = i;
++				break;
++			}
++#else
+ 			cc = ic->streams[i]->codec;
+ 			if (cc->codec_type == AVMEDIA_TYPE_AUDIO) {
+ 				stream_index = i;
+ 				break;
+ 			}
++#endif
+ 		}
+ 
+ 		if (stream_index == -1) {
+@@ -175,7 +189,13 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
+ 			break;
+ 		}
+ 
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
++		codec = avcodec_find_decoder(cp->codec_id);
++		cc = avcodec_alloc_context3(codec);
++		avcodec_parameters_to_context(cc, cp);
++#else
+ 		codec = avcodec_find_decoder(cc->codec_id);
++#endif
+ 		if (!codec) {
+ 			d_print("codec not found: %d, %s\n", cc->codec_id, avcodec_get_name(cc->codec_id));
+ 			err = -IP_ERROR_UNSUPPORTED_FILE_TYPE;
+@@ -196,6 +216,9 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
+ 
+ 	if (err < 0) {
+ 		/* Clean up.  cc is never opened at this point.  (See above assumption.) */
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
++		avcodec_free_context(&cc);
++#endif
+ 		avformat_close_input(&ic);
+ 		return err;
+ 	}
+@@ -207,6 +230,9 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
+ 	priv->input = ffmpeg_input_create();
+ 	if (priv->input == NULL) {
+ 		avcodec_close(cc);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
++		avcodec_free_context(&cc);
++#endif
+ 		avformat_close_input(&ic);
+ 		free(priv);
+ 		return -IP_ERROR_INTERNAL;
+@@ -252,6 +278,9 @@ static int ffmpeg_close(struct input_plugin_data *ip_data)
+ 	struct ffmpeg_private *priv = ip_data->private;
+ 
+ 	avcodec_close(priv->codec_context);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
++	avcodec_free_context(&priv->codec_context);
++#endif
+ 	avformat_close_input(&priv->input_context);
+ 	swr_free(&priv->swr);
+ 	ffmpeg_input_free(priv->input);
+@@ -305,7 +334,20 @@ static int ffmpeg_fill_buffer(AVFormatContext *ic, AVCodecContext *cc, struct ff
+ 			AVPacket avpkt;
+ 			av_new_packet(&avpkt, input->curr_pkt_size);
+ 			memcpy(avpkt.data, input->curr_pkt_buf, input->curr_pkt_size);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
++			if (avcodec_send_packet(cc, &avpkt) == 0) {
++				got_frame = !avcodec_receive_frame(cc, frame);
++				if (got_frame)
++					len = input->curr_pkt_size;
++				else
++					len = 0;
++			} else {
++				got_frame = 0;
++				len = 0;
++			}
++#else
+ 			len = avcodec_decode_audio4(cc, frame, &got_frame, &avpkt);
++#endif
+ #if LIBAVCODEC_VERSION_MAJOR >= 56
+ 			av_packet_unref(&avpkt);
+ #else


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-sound/cmus/files/, media-sound/cmus/
@ 2021-04-28 10:20 Miroslav Šulc
  0 siblings, 0 replies; 3+ messages in thread
From: Miroslav Šulc @ 2021-04-28 10:20 UTC (permalink / raw
  To: gentoo-commits

commit:     5b0a7da41f1215f191edc2e2519941e43f03e89f
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 28 10:20:40 2021 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Wed Apr 28 10:20:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b0a7da4

media-sound/cmus: fixed building of 2.9.1 on ppc

thanks to James Madgwick <james <AT> madgwick.xyz> for the patch

Closes: https://bugs.gentoo.org/639678
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 media-sound/cmus/cmus-2.9.1.ebuild             |  4 ++++
 media-sound/cmus/files/cmus-2.9.1-atomic.patch | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/media-sound/cmus/cmus-2.9.1.ebuild b/media-sound/cmus/cmus-2.9.1.ebuild
index f1d55a50f34..92687b13780 100644
--- a/media-sound/cmus/cmus-2.9.1.ebuild
+++ b/media-sound/cmus/cmus-2.9.1.ebuild
@@ -67,6 +67,10 @@ DOCS=( AUTHORS README.md )
 
 S="${WORKDIR}/${P/_/-}"
 
+PATCHES=(
+	"${FILESDIR}/${P}-atomic.patch"
+)
+
 src_configure() {
 	my_config() {
 		local value

diff --git a/media-sound/cmus/files/cmus-2.9.1-atomic.patch b/media-sound/cmus/files/cmus-2.9.1-atomic.patch
new file mode 100644
index 00000000000..41941a31b78
--- /dev/null
+++ b/media-sound/cmus/files/cmus-2.9.1-atomic.patch
@@ -0,0 +1,11 @@
+--- cmus-2.8.0/Makefile	2019-01-29 09:09:08.000000000 +0000
++++ cmus-2.8.0.new/Makefile	2019-06-12 14:34:13.000000000 +0000
+@@ -21,7 +21,7 @@
+ FFMPEG_CFLAGS += $(shell pkg-config --cflags libswresample)
+ FFMPEG_LIBS += $(shell pkg-config --libs libswresample)
+ 
+-CMUS_LIBS = $(PTHREAD_LIBS) $(NCURSES_LIBS) $(ICONV_LIBS) $(DL_LIBS) $(DISCID_LIBS) \
++CMUS_LIBS = -latomic $(PTHREAD_LIBS) $(NCURSES_LIBS) $(ICONV_LIBS) $(DL_LIBS) $(DISCID_LIBS) \
+ 			-lm $(COMPAT_LIBS) $(LIBSYSTEMD_LIBS)
+ 
+ command_mode.o input.o main.o ui_curses.o op/pulse.lo: .version


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-sound/cmus/files/, media-sound/cmus/
@ 2021-04-29  4:39 Miroslav Šulc
  0 siblings, 0 replies; 3+ messages in thread
From: Miroslav Šulc @ 2021-04-29  4:39 UTC (permalink / raw
  To: gentoo-commits

commit:     8459f8d0911bb834a323b9882af40b5bc21022cb
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 29 04:39:03 2021 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Thu Apr 29 04:39:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8459f8d0

media-sound/cmus: removed obsolete 2.8.0

Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 media-sound/cmus/Manifest                          |   1 -
 media-sound/cmus/cmus-2.8.0.ebuild                 | 151 ---------------------
 media-sound/cmus/files/cmus-2.8.0-elogind.patch    |  22 ---
 .../files/cmus-2.8.0-ffmpeg-deprecations.patch     | 124 -----------------
 media-sound/cmus/files/cmus-2.8.0-opus.patch       |  22 ---
 5 files changed, 320 deletions(-)

diff --git a/media-sound/cmus/Manifest b/media-sound/cmus/Manifest
index 4e5e1131446..c5a79155862 100644
--- a/media-sound/cmus/Manifest
+++ b/media-sound/cmus/Manifest
@@ -1,2 +1 @@
-DIST cmus-2.8.0.tar.gz 317243 BLAKE2B b24c3dd74797ef26b42c2c303191dd751af7bb3b5c4c6f05bfef393eda9a35371eba4658321d473f9af210321132cfba5eab4037d257dd71c38ea3e24f78067f SHA512 cf359dfcefa833a5b10a2d16ac405672bea762b62b7177c115560127035682fba65c15b9a8710179a343d1f99212a0260b5c095542982202e2cd1bef5b0c17fc
 DIST cmus-2.9.1.tar.gz 321004 BLAKE2B 1531d9ca8c1fd54ca487eb2b9ce8602f2d448dd80567a04bfc18449d60fbcd5286cd9f0d19983a885b2a532793c44d7dab8c1993ac8d7f5ada4f01ce670404d9 SHA512 b417e58a68c54e97db92b8760a49a3071e81f1594f2144911eed3ccceb68499dedf0699ae313babcb822d71b37add8880dfb2018686cb572e89f8627446d5e05

diff --git a/media-sound/cmus/cmus-2.8.0.ebuild b/media-sound/cmus/cmus-2.8.0.ebuild
deleted file mode 100644
index 1cc9fb01d88..00000000000
--- a/media-sound/cmus/cmus-2.8.0.ebuild
+++ /dev/null
@@ -1,151 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 toolchain-funcs
-
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="https://github.com/cmus/cmus.git"
-	inherit git-r3
-else
-	SRC_URI="https://github.com/cmus/cmus/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="amd64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
-fi
-
-DESCRIPTION="Ncurses based music player with plugin support for many formats"
-HOMEPAGE="https://cmus.github.io/"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="aac alsa ao cddb cdio debug discid elogind examples ffmpeg +flac jack libsamplerate
-	+mad mikmod modplug mp4 musepack opus oss pidgin pulseaudio systemd tremor +unicode
-	+vorbis wavpack"
-
-REQUIRED_USE="?? ( elogind systemd )"
-
-BDEPEND="
-	virtual/pkgconfig
-"
-DEPEND="
-	sys-libs/ncurses:0=[unicode?]
-	aac? ( media-libs/faad2 )
-	alsa? ( >=media-libs/alsa-lib-1.0.11 )
-	ao? ( media-libs/libao )
-	cddb? ( media-libs/libcddb )
-	cdio? ( dev-libs/libcdio-paranoia )
-	discid? ( media-libs/libdiscid )
-	elogind? ( sys-auth/elogind )
-	ffmpeg? ( media-video/ffmpeg:= )
-	flac? ( media-libs/flac )
-	jack? ( virtual/jack )
-	libsamplerate? ( media-libs/libsamplerate )
-	mad? ( >=media-libs/libmad-0.14 )
-	mikmod? ( media-libs/libmikmod:0 )
-	modplug? ( >=media-libs/libmodplug-0.7 )
-	mp4? ( >=media-libs/libmp4v2-1.9:0 )
-	musepack? ( >=media-sound/musepack-tools-444 )
-	opus? ( media-libs/opusfile )
-	pulseaudio? ( media-sound/pulseaudio )
-	systemd? ( sys-apps/systemd )
-	tremor? ( media-libs/tremor )
-	!tremor? ( vorbis? ( >=media-libs/libvorbis-1.0 ) )
-	wavpack? ( media-sound/wavpack )
-"
-RDEPEND="${DEPEND}
-	pidgin? (
-		dev-python/dbus-python
-		net-im/pidgin
-	)
-"
-
-# Both CONFIG_TREMOR=y and CONFIG_VORBIS=y are required to link to tremor libs instead of vorbis libs
-REQUIRED_USE="tremor? ( vorbis )
-	mp4? ( aac )" # enabling mp4 adds -lfaad
-
-DOCS=( AUTHORS README.md )
-
-PATCHES=(
-	"${FILESDIR}/${P}-elogind.patch"
-	"${FILESDIR}/${P}-ffmpeg-deprecations.patch"
-	"${FILESDIR}/${P}-opus.patch"
-)
-
-S="${WORKDIR}/${P/_/-}"
-
-src_configure() {
-	my_config() {
-		local value
-		use ${1} && value=a || value=n
-		myconf+=( ${2}=${value} )
-	}
-
-	local debuglevel=1
-	use debug && debuglevel=2
-	local myconf=(
-		CONFIG_CUE=y
-		CONFIG_ARTS=n
-		CONFIG_SUN=n
-		CONFIG_SNDIO=n
-		CONFIG_WAVEOUT=n
-		CONFIG_VTX=n
-		CONFIG_ROAR=n
-	)
-
-	my_config cddb CONFIG_CDDB
-	my_config cdio CONFIG_CDIO
-	my_config discid CONFIG_DISCID
-	my_config flac CONFIG_FLAC
-	my_config mad CONFIG_MAD
-	my_config modplug CONFIG_MODPLUG
-	my_config mikmod CONFIG_MIKMOD
-	my_config musepack CONFIG_MPC
-	my_config vorbis CONFIG_VORBIS
-	my_config tremor CONFIG_TREMOR
-	my_config opus CONFIG_OPUS
-	my_config wavpack CONFIG_WAVPACK
-	my_config mp4 CONFIG_MP4
-	my_config aac CONFIG_AAC
-	my_config ffmpeg CONFIG_FFMPEG
-	my_config pulseaudio CONFIG_PULSE
-	my_config alsa CONFIG_ALSA
-	my_config jack CONFIG_JACK
-	my_config libsamplerate CONFIG_SAMPLERATE
-	my_config ao CONFIG_AO
-	my_config oss CONFIG_OSS
-
-	if use elogind || use systemd; then
-		myconf+=( CONFIG_MPRIS=a )
-	else
-		myconf+=( CONFIG_MPRIS=n )
-	fi
-
-	./configure prefix="${EPREFIX}"/usr "${myconf[@]}" \
-		exampledir="${EPREFIX}"/usr/share/doc/${PF}/examples \
-		libdir="${EPREFIX}"/usr/$(get_libdir) DEBUG=${debuglevel} || die
-}
-
-src_compile() {
-	tc-export_build_env BUILD_CC
-	emake V=2 \
-		CC="$(tc-getCC)" LD="$(tc-getCC)" \
-		HOSTCC="${BUILD_CC}" HOSTLD="${BUILD_CC}" \
-		HOST_CFLAGS="${BUILD_CFLAGS}" HOST_LDFLAGS="${BUILD_LDFLAGS}"
-}
-
-src_install() {
-	default
-
-	if ! use examples; then
-		rm -rf "${ED}"/usr/share/doc/${PF}/examples || die
-	fi
-
-	insinto /usr/share/zsh/site-functions
-	doins contrib/_cmus
-
-	newbashcomp contrib/${PN}.bash-completion ${PN}
-
-	if use pidgin; then
-		newbin contrib/cmus-updatepidgin.py cmus-updatepidgin
-	fi
-}

diff --git a/media-sound/cmus/files/cmus-2.8.0-elogind.patch b/media-sound/cmus/files/cmus-2.8.0-elogind.patch
deleted file mode 100644
index e1309c78911..00000000000
--- a/media-sound/cmus/files/cmus-2.8.0-elogind.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 483d1862ed023c3e00f2c8c4e71da40022af2f78 Mon Sep 17 00:00:00 2001
-From: Shiba <3816409+shibotto@users.noreply.github.com>
-Date: Tue, 12 Feb 2019 15:29:43 +0100
-Subject: [PATCH] Add support for elogind (#846)
-
----
- configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index 1f46c30a..4627126e 100755
---- a/configure
-+++ b/configure
-@@ -289,7 +289,7 @@ check_vorbis()
- 
- check_libsystemd()
- {
--	pkg_config LIBSYSTEMD "libsystemd"
-+	pkg_config LIBSYSTEMD "libsystemd" || pkg_config LIBSYSTEMD "libelogind >= 239.3"
- 	return $?
- }
- 

diff --git a/media-sound/cmus/files/cmus-2.8.0-ffmpeg-deprecations.patch b/media-sound/cmus/files/cmus-2.8.0-ffmpeg-deprecations.patch
deleted file mode 100644
index 941f47e3d49..00000000000
--- a/media-sound/cmus/files/cmus-2.8.0-ffmpeg-deprecations.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From 9877eb02381fd4c57059f9c77be03127c28d8f88 Mon Sep 17 00:00:00 2001
-From: Niko E <nefthy@users.noreply.github.com>
-Date: Mon, 11 Feb 2019 09:09:21 +0100
-Subject: [PATCH] Fixes ffmpeg deprecations (#861)
-
-- av_register_all is no longer needed since 4.0
-- AVStream::codec is deprecated since 3.1
-- avcodec_decode_audio4 is deprecated since 3.1
----
- ip/ffmpeg.c | 42 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 42 insertions(+)
-
-diff --git a/ip/ffmpeg.c b/ip/ffmpeg.c
-index eaad5c4f..418a37f8 100644
---- a/ip/ffmpeg.c
-+++ b/ip/ffmpeg.c
-@@ -128,9 +128,11 @@ static void ffmpeg_init(void)
- 
- 	av_log_set_level(AV_LOG_QUIET);
- 
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 18, 100)
- 	/* We could register decoders explicitly to save memory, but we have to
- 	 * be careful about compatibility. */
- 	av_register_all();
-+#endif
- }
- 
- static int ffmpeg_open(struct input_plugin_data *ip_data)
-@@ -143,6 +145,9 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
- 	AVCodec *codec;
- 	AVCodecContext *cc = NULL;
- 	AVFormatContext *ic = NULL;
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
-+	AVCodecParameters *cp = NULL;
-+#endif
- 	SwrContext *swr = NULL;
- 
- 	ffmpeg_init();
-@@ -162,11 +167,20 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
- 		}
- 
- 		for (i = 0; i < ic->nb_streams; i++) {
-+
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
-+			cp = ic->streams[i]->codecpar;
-+			if (cp->codec_type == AVMEDIA_TYPE_AUDIO) {
-+				stream_index = i;
-+				break;
-+			}
-+#else
- 			cc = ic->streams[i]->codec;
- 			if (cc->codec_type == AVMEDIA_TYPE_AUDIO) {
- 				stream_index = i;
- 				break;
- 			}
-+#endif
- 		}
- 
- 		if (stream_index == -1) {
-@@ -175,7 +189,13 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
- 			break;
- 		}
- 
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
-+		codec = avcodec_find_decoder(cp->codec_id);
-+		cc = avcodec_alloc_context3(codec);
-+		avcodec_parameters_to_context(cc, cp);
-+#else
- 		codec = avcodec_find_decoder(cc->codec_id);
-+#endif
- 		if (!codec) {
- 			d_print("codec not found: %d, %s\n", cc->codec_id, avcodec_get_name(cc->codec_id));
- 			err = -IP_ERROR_UNSUPPORTED_FILE_TYPE;
-@@ -196,6 +216,9 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
- 
- 	if (err < 0) {
- 		/* Clean up.  cc is never opened at this point.  (See above assumption.) */
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
-+		avcodec_free_context(&cc);
-+#endif
- 		avformat_close_input(&ic);
- 		return err;
- 	}
-@@ -207,6 +230,9 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
- 	priv->input = ffmpeg_input_create();
- 	if (priv->input == NULL) {
- 		avcodec_close(cc);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
-+		avcodec_free_context(&cc);
-+#endif
- 		avformat_close_input(&ic);
- 		free(priv);
- 		return -IP_ERROR_INTERNAL;
-@@ -252,6 +278,9 @@ static int ffmpeg_close(struct input_plugin_data *ip_data)
- 	struct ffmpeg_private *priv = ip_data->private;
- 
- 	avcodec_close(priv->codec_context);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
-+	avcodec_free_context(&priv->codec_context);
-+#endif
- 	avformat_close_input(&priv->input_context);
- 	swr_free(&priv->swr);
- 	ffmpeg_input_free(priv->input);
-@@ -305,7 +334,20 @@ static int ffmpeg_fill_buffer(AVFormatContext *ic, AVCodecContext *cc, struct ff
- 			AVPacket avpkt;
- 			av_new_packet(&avpkt, input->curr_pkt_size);
- 			memcpy(avpkt.data, input->curr_pkt_buf, input->curr_pkt_size);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
-+			if (avcodec_send_packet(cc, &avpkt) == 0) {
-+				got_frame = !avcodec_receive_frame(cc, frame);
-+				if (got_frame)
-+					len = input->curr_pkt_size;
-+				else
-+					len = 0;
-+			} else {
-+				got_frame = 0;
-+				len = 0;
-+			}
-+#else
- 			len = avcodec_decode_audio4(cc, frame, &got_frame, &avpkt);
-+#endif
- #if LIBAVCODEC_VERSION_MAJOR >= 56
- 			av_packet_unref(&avpkt);
- #else

diff --git a/media-sound/cmus/files/cmus-2.8.0-opus.patch b/media-sound/cmus/files/cmus-2.8.0-opus.patch
deleted file mode 100644
index ea95fa8536c..00000000000
--- a/media-sound/cmus/files/cmus-2.8.0-opus.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 0be981476e019e9fddb5529a73aadf004e94656b Mon Sep 17 00:00:00 2001
-From: tomty89 <tom.ty89@gmail.com>
-Date: Tue, 12 Feb 2019 18:55:09 +0800
-Subject: [PATCH] ip/ffmpeg: enable opus support (#865)
-
----
- ip/ffmpeg.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/ip/ffmpeg.c b/ip/ffmpeg.c
-index 04b916cc..427257c7 100644
---- a/ip/ffmpeg.c
-+++ b/ip/ffmpeg.c
-@@ -519,7 +519,7 @@ const int ip_priority = 30;
- const char *const ip_extensions[] = {
- 	"aa", "aac", "ac3", "aif", "aifc", "aiff", "ape", "au", "fla", "flac",
- 	"m4a", "m4b", "mka", "mkv", "mp+", "mp2", "mp3", "mp4", "mpc", "mpp",
--	"ogg", "shn", "tak", "tta", "wav", "webm", "wma", "wv",
-+	"ogg", "opus", "shn", "tak", "tta", "wav", "webm", "wma", "wv",
- #ifdef USE_FALLBACK_IP
- 	"*",
- #endif


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-29  4:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-20 12:29 [gentoo-commits] repo/gentoo:master commit in: media-sound/cmus/files/, media-sound/cmus/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2021-04-28 10:20 Miroslav Šulc
2021-04-29  4:39 Miroslav Šulc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox