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-libs/chromaprint/files/, media-libs/chromaprint/
Date: Fri, 30 Oct 2015 14:31:31
Message-Id: 1446215477.aa9e027ad7f15145076741af9d666b409167f561.aballier@gentoo
1 commit: aa9e027ad7f15145076741af9d666b409167f561
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 30 14:31:09 2015 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 30 14:31:17 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa9e027a
7
8 media-libs/chromaprint: Backport fix from upstream to build with ffmpeg git master.
9
10 Package-Manager: portage-2.2.23
11
12 media-libs/chromaprint/chromaprint-1.2.ebuild | 4 +-
13 .../files/chromaprint-1.2-ffmpeg29.patch | 48 ++++++++++++++++++++++
14 2 files changed, 50 insertions(+), 2 deletions(-)
15
16 diff --git a/media-libs/chromaprint/chromaprint-1.2.ebuild b/media-libs/chromaprint/chromaprint-1.2.ebuild
17 index 670ff38..c0de492 100644
18 --- a/media-libs/chromaprint/chromaprint-1.2.ebuild
19 +++ b/media-libs/chromaprint/chromaprint-1.2.ebuild
20 @@ -17,7 +17,7 @@ IUSE="libav test tools"
21 # note: use ffmpeg or libav instead of fftw because it's recommended and required for tools
22 RDEPEND="
23 libav? ( media-video/libav:0= )
24 - !libav? ( media-video/ffmpeg:0= )
25 + !libav? ( >=media-video/ffmpeg-2.6:0= )
26 "
27 DEPEND="${RDEPEND}
28 test? (
29 @@ -27,7 +27,7 @@ DEPEND="${RDEPEND}
30
31 DOCS="NEWS.txt README.md"
32
33 -PATCHES=( "${FILESDIR}"/${PN}-1.1-gtest.patch )
34 +PATCHES=( "${FILESDIR}"/${PN}-1.1-gtest.patch "${FILESDIR}"/${P}-ffmpeg29.patch )
35
36 src_configure() {
37 local mycmakeargs=(
38
39 diff --git a/media-libs/chromaprint/files/chromaprint-1.2-ffmpeg29.patch b/media-libs/chromaprint/files/chromaprint-1.2-ffmpeg29.patch
40 new file mode 100644
41 index 0000000..6910f24
42 --- /dev/null
43 +++ b/media-libs/chromaprint/files/chromaprint-1.2-ffmpeg29.patch
44 @@ -0,0 +1,48 @@
45 +commit 37092d380a28abcc63fa120499030a0f2b7df80f
46 +Author: Rodger Combs <rodger.combs@×××××.com>
47 +Date: Fri Oct 2 14:48:01 2015 -0500
48 +
49 + fpcalc: remove uses of deprecated lavc APIs
50 +
51 +Index: chromaprint-1.2/examples/fpcalc.c
52 +===================================================================
53 +--- chromaprint-1.2.orig/examples/fpcalc.c
54 ++++ chromaprint-1.2/examples/fpcalc.c
55 +@@ -17,10 +17,6 @@
56 + #define MAX(a, b) ((a) > (b) ? (a) : (b))
57 + #define MIN(a, b) ((a) < (b) ? (a) : (b))
58 +
59 +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 28, 0)
60 +-#define avcodec_free_frame av_freep
61 +-#endif
62 +-
63 + int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name, int max_length, int *duration)
64 + {
65 + int ok = 0, remaining, length, consumed, codec_ctx_opened = 0, got_frame, stream_index;
66 +@@ -131,7 +127,7 @@ int decode_audio_file(ChromaprintContext
67 + remaining = max_length * codec_ctx->channels * codec_ctx->sample_rate;
68 + chromaprint_start(chromaprint_ctx, codec_ctx->sample_rate, codec_ctx->channels);
69 +
70 +- frame = avcodec_alloc_frame();
71 ++ frame = av_frame_alloc();
72 +
73 + while (1) {
74 + if (av_read_frame(format_ctx, &packet) < 0) {
75 +@@ -139,7 +135,7 @@ int decode_audio_file(ChromaprintContext
76 + }
77 +
78 + if (packet.stream_index == stream_index) {
79 +- avcodec_get_frame_defaults(frame);
80 ++ av_frame_unref(frame);
81 +
82 + got_frame = 0;
83 + consumed = avcodec_decode_audio4(codec_ctx, frame, &got_frame, &packet);
84 +@@ -196,7 +192,7 @@ finish:
85 +
86 + done:
87 + if (frame) {
88 +- avcodec_free_frame(&frame);
89 ++ av_frame_free(&frame);
90 + }
91 + if (dst_data[0]) {
92 + av_freep(&dst_data[0]);