From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 61012138334 for ; Wed, 20 Mar 2019 12:29:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5765DE089D; Wed, 20 Mar 2019 12:29:56 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1941FE089D for ; Wed, 20 Mar 2019 12:29:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 20E7B335D24 for ; Wed, 20 Mar 2019 12:29:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7DB27576 for ; Wed, 20 Mar 2019 12:29:52 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1553084973.7549e0ff4dec4ef6624a74bda69990abda1910c8.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/cmus/files/, media-sound/cmus/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-sound/cmus/cmus-2.8.0.ebuild media-sound/cmus/files/cmus-2.8.0-ffmpeg-deprecations.patch X-VCS-Directories: media-sound/cmus/ media-sound/cmus/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 7549e0ff4dec4ef6624a74bda69990abda1910c8 X-VCS-Branch: master Date: Wed, 20 Mar 2019 12:29:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 88fdec80-0f22-48e1-8515-b062001bd0fe X-Archives-Hash: 79226b30027a339e74d36a3570394e34 commit: 7549e0ff4dec4ef6624a74bda69990abda1910c8 Author: Andreas Sturmlechner gentoo org> AuthorDate: Wed Mar 20 11:57:41 2019 +0000 Commit: Andreas Sturmlechner gentoo 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 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 +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