Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/spek/files/, media-sound/spek/
Date: Mon, 05 Dec 2016 11:02:23
Message-Id: 1480935726.80ba3a79d1639271ad0d3931e59c19bb2836abba.aballier@gentoo
1 commit: 80ba3a79d1639271ad0d3931e59c19bb2836abba
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 5 11:01:55 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 5 11:02:06 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80ba3a79
7
8 media-sound/spek: backport upstream patches to build with ffmpeg3; bug #575060
9
10 Package-Manager: portage-2.3.2
11
12 media-sound/spek/files/spek-0.8.3-ffmpeg3-1.patch | 33 ++++++++++++++++++++
13 media-sound/spek/files/spek-0.8.3-ffmpeg3.patch | 37 +++++++++++++++++++++++
14 media-sound/spek/spek-0.8.3-r1.ebuild | 6 ++--
15 3 files changed, 74 insertions(+), 2 deletions(-)
16
17 diff --git a/media-sound/spek/files/spek-0.8.3-ffmpeg3-1.patch b/media-sound/spek/files/spek-0.8.3-ffmpeg3-1.patch
18 new file mode 100644
19 index 00000000..dee0e3c
20 --- /dev/null
21 +++ b/media-sound/spek/files/spek-0.8.3-ffmpeg3-1.patch
22 @@ -0,0 +1,33 @@
23 +https://github.com/alexkay/spek/commit/ee8bc49ed4a93a14a933ecb0eebfe424111f8413
24 +
25 +Index: spek-0.8.3/src/spek-audio.cc
26 +===================================================================
27 +--- spek-0.8.3.orig/src/spek-audio.cc
28 ++++ spek-0.8.3/src/spek-audio.cc
29 +@@ -202,7 +202,7 @@ AudioFileImpl::AudioFileImpl(
30 + this->packet.data = nullptr;
31 + this->packet.size = 0;
32 + this->offset = 0;
33 +- this->frame = avcodec_alloc_frame();
34 ++ this->frame = av_frame_alloc();
35 + this->buffer_size = 0;
36 + this->buffer = nullptr;
37 + this->frames_per_interval = 0;
38 +@@ -218,7 +218,7 @@ AudioFileImpl::~AudioFileImpl()
39 + if (this->frame) {
40 + // TODO: Remove this check after Debian switches to libav 9.
41 + #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
42 +- avcodec_free_frame(&this->frame);
43 ++ av_frame_free(&this->frame);
44 + #else
45 + av_freep(&this->frame);
46 + #endif
47 +@@ -258,7 +258,7 @@ int AudioFileImpl::read()
48 +
49 + for (;;) {
50 + while (this->packet.size > 0) {
51 +- avcodec_get_frame_defaults(this->frame);
52 ++ av_frame_unref(this->frame);
53 + auto codec_context = this->format_context->streams[this->audio_stream]->codec;
54 + int got_frame = 0;
55 + int len = avcodec_decode_audio4(codec_context, this->frame, &got_frame, &this->packet);
56
57 diff --git a/media-sound/spek/files/spek-0.8.3-ffmpeg3.patch b/media-sound/spek/files/spek-0.8.3-ffmpeg3.patch
58 new file mode 100644
59 index 00000000..ad82a38
60 --- /dev/null
61 +++ b/media-sound/spek/files/spek-0.8.3-ffmpeg3.patch
62 @@ -0,0 +1,37 @@
63 +commit 1ef950dcbf89dd8adf816009b54009f487828a45
64 +Author: Andreas Cadhalpun <Andreas.Cadhalpun@××××××××××.com>
65 +Date: Sun Mar 27 14:19:42 2016 -0700
66 +
67 + Replace deprecated FFmpeg API
68 +
69 +diff --git a/src/spek-audio.cc b/src/spek-audio.cc
70 +index b7633bc..21ea7a4 100644
71 +--- a/src/spek-audio.cc
72 ++++ b/src/spek-audio.cc
73 +@@ -222,7 +222,7 @@ AudioFileImpl::~AudioFileImpl()
74 + this->packet.data -= this->offset;
75 + this->packet.size += this->offset;
76 + this->offset = 0;
77 +- av_free_packet(&this->packet);
78 ++ av_packet_unref(&this->packet);
79 + }
80 + if (this->format_context) {
81 + if (this->audio_stream >= 0) {
82 +@@ -326,7 +326,7 @@ int AudioFileImpl::read()
83 + this->packet.data -= this->offset;
84 + this->packet.size += this->offset;
85 + this->offset = 0;
86 +- av_free_packet(&this->packet);
87 ++ av_packet_unref(&this->packet);
88 + }
89 +
90 + int res = 0;
91 +@@ -334,7 +334,7 @@ int AudioFileImpl::read()
92 + if (this->packet.stream_index == this->audio_stream) {
93 + break;
94 + }
95 +- av_free_packet(&this->packet);
96 ++ av_packet_unref(&this->packet);
97 + }
98 + if (res < 0) {
99 + // End of file or error.
100
101 diff --git a/media-sound/spek/spek-0.8.3-r1.ebuild b/media-sound/spek/spek-0.8.3-r1.ebuild
102 index 8a90995..4becb5f 100644
103 --- a/media-sound/spek/spek-0.8.3-r1.ebuild
104 +++ b/media-sound/spek/spek-0.8.3-r1.ebuild
105 @@ -1,4 +1,4 @@
106 -# Copyright 1999-2014 Gentoo Foundation
107 +# Copyright 1999-2016 Gentoo Foundation
108 # Distributed under the terms of the GNU General Public License v2
109 # $Id$
110
111 @@ -41,6 +41,8 @@ src_prepare() {
112 epatch \
113 "${FILESDIR}"/${PN}-0.8.1-disable-updates.patch \
114 "${FILESDIR}"/${P}-replace-gnu+11-with-c++11.patch \
115 - "${FILESDIR}"/${P}-stdlib.patch
116 + "${FILESDIR}"/${P}-stdlib.patch \
117 + "${FILESDIR}"/${P}-ffmpeg3.patch \
118 + "${FILESDIR}"/${P}-ffmpeg3-1.patch
119 eautoreconf
120 }