public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/chromaprint/, media-libs/chromaprint/files/
@ 2015-10-30 14:45 Alexis Ballier
  0 siblings, 0 replies; 5+ messages in thread
From: Alexis Ballier @ 2015-10-30 14:45 UTC (permalink / raw
  To: gentoo-commits

commit:     9d13a601d77a0e22d4bd8cd5b1079709518517c1
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 30 14:32:46 2015 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 30 14:45:33 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d13a601

media-libs/chromaprint: remove old.

Package-Manager: portage-2.2.23

 media-libs/chromaprint/Manifest                    |  3 --
 media-libs/chromaprint/chromaprint-0.6.ebuild      | 45 -----------------
 media-libs/chromaprint/chromaprint-0.7.ebuild      | 52 -------------------
 media-libs/chromaprint/chromaprint-1.1.ebuild      | 56 --------------------
 .../chromaprint/files/chromaprint-0.7-boost.patch  |  8 ---
 .../chromaprint/files/chromaprint-0.7-ffmpeg.patch | 43 ----------------
 .../chromaprint/files/chromaprint-0.7-libav9.patch | 44 ----------------
 .../chromaprint/files/chromaprint-1.0-libav9.patch | 11 ----
 .../files/chromaprint-1.1-ffmpeg2.patch            | 13 -----
 ...chromaprint-1.1-libav_build_fix_for_tools.patch | 59 ----------------------
 10 files changed, 334 deletions(-)

diff --git a/media-libs/chromaprint/Manifest b/media-libs/chromaprint/Manifest
index 11f8522..fcdbdff 100644
--- a/media-libs/chromaprint/Manifest
+++ b/media-libs/chromaprint/Manifest
@@ -1,4 +1 @@
-DIST chromaprint-0.6.tar.gz 542366 SHA256 5d9b82da226450c14e43482371a1b2a178e2604ab5b2e9259f33b1b461ee9d63 SHA512 8786c84877663d991d3114776c92b47eb4d813a338e312956a54c444ff07bca05692a019145c722bcbfadd8c2e4c2b6c5ccb0eb784d96d41f58b143e8d57db24 WHIRLPOOL 2ed6ccb8e36393afae971873455bb38bd801daf94912badeca067162a5ab467215799439bfb3afcb51bd302435bcd479b9a991d4f4db90c4783e6a43fe94b09f
-DIST chromaprint-0.7.tar.gz 543811 SHA256 4e52c3fd443c91a5c429557753d4ba3f9d31d183810412c0d8600892f3975501 SHA512 2ac03f80888d6c12dd05c20adc82e0f2c9e6bf5edc099d7c7b719b8cb353151fb04b78f5c7bca672d5fe8357a791e86fdea7b6952a0d64c346c079548ebfcd38 WHIRLPOOL 34c5cb7c38dc0e4924e068ff0a695e571fdd2233046ef6ea84e9e0e27e6bf9f5eaedceb79c2f8120e9ac6eb30ace3bc9e15ba59027cd498426e7f94536e2da84
-DIST chromaprint-1.1.tar.gz 542360 SHA256 6b14d7ea4964581b73bd3f8038c8857c01e446421c1ae99cbbf64de26b47cd12 SHA512 3d439dfca979e2babc8d2c171b5cb36fd0a5d3b7475e02a0f8bae436f7096e189674b640119f0dccf7cc2cd214bd8674d46b018952f1e3e93ddc0ba19b5155f9 WHIRLPOOL 726c7710f7bd1c138d7ebd1de263a0e214cbd79faf60e35034a60cfd68a9d3b4e52fc1cc93ce4dc7d39683e3a5ac1d7e9bd6c8046cdb5cece83b9c2fbf4971b5
 DIST chromaprint-1.2.tar.gz 529646 SHA256 822b8949a322ac04c6f8a3ed78f5e689bcc493c6ca0972bf627c913c8430031a SHA512 dc61db8894a20df3d7e7317cd7cd97148c19be5854dd66409341cb8e47c045e1c632b254e14a869279983a5af2cc6f9effea21b77a63dff729511e6144439cbb WHIRLPOOL b2efb45c23e950b6a4d95c078bed15b03ef35e423b106428a7607034276b343b8c223ffa71e021846ed48f535663e062ae8042d281d769a04effc9afd8a600dd

diff --git a/media-libs/chromaprint/chromaprint-0.6.ebuild b/media-libs/chromaprint/chromaprint-0.6.ebuild
deleted file mode 100644
index 1399c0c..0000000
--- a/media-libs/chromaprint/chromaprint-0.6.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=4
-inherit cmake-utils
-
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
-HOMEPAGE="http://acoustid.org/chromaprint"
-SRC_URI="mirror://github/lalinsky/${PN}/${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0"
-KEYWORDS="amd64 x86"
-IUSE="test tools"
-
-# note: use ffmpeg instead of fftw because it's recommended and required for tools
-RDEPEND=">=virtual/ffmpeg-0.6
-	tools? ( >=media-libs/taglib-1.6 )"
-DEPEND="${RDEPEND}
-	test? ( dev-cpp/gtest )
-	tools? ( dev-libs/boost )"
-
-DOCS="NEWS.txt README.txt"
-
-src_configure() {
-	local mycmakeargs=(
-		$(cmake-utils_use_build tools EXAMPLES)
-		$(cmake-utils_use_build test TESTS)
-		$(cmake-utils_use_build tools)
-		-DWITH_AVFFT=ON
-		)
-
-	cmake-utils_src_configure
-}
-
-src_test() {
-	cd "${CMAKE_BUILD_DIR}" || die
-	emake check
-}
-
-src_install() {
-	cmake-utils_src_install
-	use tools && dobin "${CMAKE_BUILD_DIR}"/tools/fpcollect
-}

diff --git a/media-libs/chromaprint/chromaprint-0.7.ebuild b/media-libs/chromaprint/chromaprint-0.7.ebuild
deleted file mode 100644
index 062c6e0..0000000
--- a/media-libs/chromaprint/chromaprint-0.7.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=4
-inherit cmake-utils
-
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
-HOMEPAGE="http://acoustid.org/chromaprint"
-SRC_URI="mirror://github/lalinsky/${PN}/${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0"
-KEYWORDS="amd64 ~ppc x86"
-IUSE="test tools"
-
-# note: use ffmpeg instead of fftw because it's recommended and required for tools
-RDEPEND=">=virtual/ffmpeg-0.10
-	tools? ( >=media-libs/taglib-1.6 )"
-DEPEND="${RDEPEND}
-	test? (
-		dev-cpp/gtest
-		dev-libs/boost
-	)
-	tools? ( dev-libs/boost )"
-
-DOCS="NEWS.txt README.txt"
-
-PATCHES=( "${FILESDIR}"/${P}-boost.patch
-		  "${FILESDIR}"/${P}-ffmpeg.patch
-		  "${FILESDIR}"/${P}-libav9.patch )
-
-src_configure() {
-	local mycmakeargs=(
-		$(cmake-utils_use_build tools EXAMPLES)
-		$(cmake-utils_use_build test TESTS)
-		$(cmake-utils_use_build tools)
-		-DWITH_AVFFT=ON
-		)
-
-	cmake-utils_src_configure
-}
-
-src_test() {
-	cd "${CMAKE_BUILD_DIR}" || die
-	emake check
-}
-
-src_install() {
-	cmake-utils_src_install
-	use tools && dobin "${CMAKE_BUILD_DIR}"/tools/fpcollect
-}

diff --git a/media-libs/chromaprint/chromaprint-1.1.ebuild b/media-libs/chromaprint/chromaprint-1.1.ebuild
deleted file mode 100644
index 80080d9..0000000
--- a/media-libs/chromaprint/chromaprint-1.1.ebuild
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit cmake-utils
-
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
-HOMEPAGE="http://acoustid.org/chromaprint"
-SRC_URI="https://bitbucket.org/acoustid/${PN}/downloads/${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0"
-KEYWORDS="amd64 ~ppc x86 ~amd64-fbsd"
-IUSE="test tools"
-
-# note: use ffmpeg instead of fftw because it's recommended and required for tools
-RDEPEND="
-	>=virtual/ffmpeg-0.10
-	tools? ( >=media-libs/taglib-1.6 )"
-DEPEND="${RDEPEND}
-	test? (
-		dev-cpp/gtest
-		dev-libs/boost
-	)
-	tools? ( dev-libs/boost )"
-
-DOCS="NEWS.txt README.txt"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-0.7-ffmpeg.patch
-	"${FILESDIR}"/${P}-gtest.patch
-	"${FILESDIR}"/${P}-ffmpeg2.patch
-	"${FILESDIR}"/${P}-libav_build_fix_for_tools.patch
-)
-
-src_configure() {
-	local mycmakeargs=(
-		$(cmake-utils_use_build tools EXAMPLES)
-		$(cmake-utils_use_build test TESTS)
-		$(cmake-utils_use_build tools)
-		-DWITH_AVFFT=ON
-		)
-	cmake-utils_src_configure
-}
-
-src_test() {
-	cd "${BUILD_DIR}" || die
-	emake check
-}
-
-src_install() {
-	cmake-utils_src_install
-	use tools && dobin "${BUILD_DIR}"/tools/fpcollect
-}

diff --git a/media-libs/chromaprint/files/chromaprint-0.7-boost.patch b/media-libs/chromaprint/files/chromaprint-0.7-boost.patch
deleted file mode 100644
index 46df857..0000000
--- a/media-libs/chromaprint/files/chromaprint-0.7-boost.patch
+++ /dev/null
@@ -1,8 +0,0 @@
---- chromaprint-0.7/tests/CMakeLists.txt
-+++ chromaprint-0.7/tests/CMakeLists.txt
-@@ -1,4 +1,5 @@
- include_directories(
-+	${Boost_INCLUDE_DIRS}
- 	${GTEST_INCLUDE_DIRS}
- 	${CMAKE_CURRENT_SOURCE_DIR}/../src
- )

diff --git a/media-libs/chromaprint/files/chromaprint-0.7-ffmpeg.patch b/media-libs/chromaprint/files/chromaprint-0.7-ffmpeg.patch
deleted file mode 100644
index f51e779..0000000
--- a/media-libs/chromaprint/files/chromaprint-0.7-ffmpeg.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=435856
-https://raw.github.com/pld-linux/chromaprint/master/chromaprint-ffmpeg.patch
-
---- chromaprint-0.7/src/ext/ffmpeg_decoder.h.orig	2012-09-05 20:05:36.000000000 +0200
-+++ chromaprint-0.7/src/ext/ffmpeg_decoder.h	2012-10-10 17:59:58.632685943 +0200
-@@ -80,7 +80,7 @@
- 		avcodec_close(m_codec_ctx);
- 	}
- 	if (m_format_ctx) {
--		av_close_input_file(m_format_ctx);
-+		avformat_close_input(&m_format_ctx);
- 	}
- 	//av_audio_convert_free(m_convert_ctx);
- 	av_free(m_buffer2);
-@@ -89,12 +89,12 @@
- 
- inline bool Decoder::Open()
- {
--	if (av_open_input_file(&m_format_ctx, m_file_name.c_str(), NULL, 0, NULL) != 0) {
-+	if (avformat_open_input(&m_format_ctx, m_file_name.c_str(), NULL, NULL) != 0) {
- 		m_error = "Couldn't open the file." + m_file_name;
- 		return false;
- 	}
- 
--	if (av_find_stream_info(m_format_ctx) < 0) {
-+	if (avformat_find_stream_info(m_format_ctx, NULL) < 0) {
- 		m_error = "Couldn't find stream information in the file.";
- 		return false;
- 	}
-@@ -129,11 +129,11 @@
- 		return false;
- 	}
- 
--	if (m_codec_ctx->sample_fmt != SAMPLE_FMT_S16) {
-+	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
- 		m_error = "Unsupported sample format.\n";
- 		return false;
- 	}
--	/*m_convert_ctx = av_audio_convert_alloc(SAMPLE_FMT_S16, 1,
-+	/*m_convert_ctx = av_audio_convert_alloc(AV_SAMPLE_FMT_S16, 1,
- 	                                       m_codec_ctx->sample_fmt, 1,
- 										   NULL, 0);
- 	if (!m_convert_ctx) {

diff --git a/media-libs/chromaprint/files/chromaprint-0.7-libav9.patch b/media-libs/chromaprint/files/chromaprint-0.7-libav9.patch
deleted file mode 100644
index c520970..0000000
--- a/media-libs/chromaprint/files/chromaprint-0.7-libav9.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -burN chromaprint-0.7.orig//src/fft_lib_avfft.h chromaprint-0.7/src/fft_lib_avfft.h
---- chromaprint-0.7.orig//src/fft_lib_avfft.h	2012-09-05 20:05:36.000000000 +0200
-+++ chromaprint-0.7/src/fft_lib_avfft.h	2013-02-16 17:34:08.682624779 +0100
-@@ -25,6 +25,7 @@
- extern "C" {
- #include <libavcodec/avcodec.h>
- #include <libavcodec/avfft.h>
-+#include <libavutil/mem.h>
- }
- #include "combined_buffer.h"
- 
-diff -burN chromaprint-0.7.orig/examples/fpcalc.c chromaprint-0.7/work/chromaprint-0.7/examples/fpcalc.c
---- chromaprint-0.7.orig/examples/fpcalc.c	2012-09-05 20:05:36.000000000 +0200
-+++ chromaprint-0.7/examples/fpcalc.c	2013-02-16 17:40:09.947611629 +0100
-@@ -42,7 +42,7 @@
- 		goto done;
- 	}
- 
--	if (av_find_stream_info(format_ctx) < 0) {
-+	if (avformat_find_stream_info(format_ctx, NULL) < 0) {
- 		fprintf(stderr, "ERROR: couldn't find stream information in the file\n");
- 		goto done;
- 	}
-@@ -65,7 +65,7 @@
- 		goto done;
- 	}
- 
--	if (avcodec_open(codec_ctx, codec) < 0) {
-+	if (avcodec_open2(codec_ctx, codec, NULL) < 0) {
- 		fprintf(stderr, "ERROR: couldn't open the codec\n");
- 		goto done;
- 	}
-diff -burN chromaprint-0.7.orig/src/ext/ffmpeg_decoder.h chromaprint-0.7/src/ext/ffmpeg_decoder.h
---- chromaprint-0.7.orig/src/ext/ffmpeg_decoder.h	2013-02-16 17:49:06.799592088 +0100
-+++ chromaprint-0.7/src/ext/ffmpeg_decoder.h	2013-02-16 17:49:54.037590369 +0100
-@@ -124,7 +124,7 @@
- 		return false;
- 	}
- 
--	if (avcodec_open(m_codec_ctx, codec) < 0) {
-+	if (avcodec_open2(m_codec_ctx, codec, NULL) < 0) {
- 		m_error = "Couldn't open the codec.";
- 		return false;
- 	}

diff --git a/media-libs/chromaprint/files/chromaprint-1.0-libav9.patch b/media-libs/chromaprint/files/chromaprint-1.0-libav9.patch
deleted file mode 100644
index e816790..0000000
--- a/media-libs/chromaprint/files/chromaprint-1.0-libav9.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- chromaprint-1.0.orig/src/ext/ffmpeg_decoder.h	2013-11-03 17:32:04.347686878 +0800
-+++ chromaprint-1.0/src/ext/ffmpeg_decoder.h	2013-11-03 17:32:41.082686494 +0800
-@@ -124,7 +124,7 @@
- 		return false;
- 	}
- 
--	if (avcodec_open(m_codec_ctx, codec) < 0) {
-+	if (avcodec_open2(m_codec_ctx, codec, NULL) < 0) {
- 		m_error = "Couldn't open the codec.";
- 		return false;
- 	}

diff --git a/media-libs/chromaprint/files/chromaprint-1.1-ffmpeg2.patch b/media-libs/chromaprint/files/chromaprint-1.1-ffmpeg2.patch
deleted file mode 100644
index 2a68de3..0000000
--- a/media-libs/chromaprint/files/chromaprint-1.1-ffmpeg2.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- chromaprint-1.1/src/ext/ffmpeg_decoder.h
-+++ chromaprint-1.1/src/ext/ffmpeg_decoder.h
-@@ -28,6 +28,10 @@
- }
- #include "audio_consumer.h"
- 
-+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
-+#  define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
-+#endif
-+
- class Decoder
- {
- public:

diff --git a/media-libs/chromaprint/files/chromaprint-1.1-libav_build_fix_for_tools.patch b/media-libs/chromaprint/files/chromaprint-1.1-libav_build_fix_for_tools.patch
deleted file mode 100644
index b53f798..0000000
--- a/media-libs/chromaprint/files/chromaprint-1.1-libav_build_fix_for_tools.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-http://bugs.gentoo.org/498194
-http://bitbucket.org/acoustid/chromaprint/commits/90822f6eee64da2941c9cbd9cd41a9664fead1d4
-
-From 90822f6eee64da2941c9cbd9cd41a9664fead1d4 Mon Sep 17 00:00:00 2001
-From: Urs Fleisch <ufleisch@users.sourceforge.net>
-Date: Sat, 28 Dec 2013 09:47:31 +0100
-Subject: [PATCH] Build fpcalc if neither HAVE_SWRESAMPLE nor HAVE_AVRESAMPLE
- defined, issue #11.
-
----
- examples/fpcalc.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/examples/fpcalc.c b/examples/fpcalc.c
-index a4b0ff9..e73e358 100644
---- a/examples/fpcalc.c
-+++ b/examples/fpcalc.c
-@@ -33,6 +33,8 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name
- 	SwrContext *convert_ctx = NULL;
- #elif defined(HAVE_AVRESAMPLE)
- 	AVAudioResampleContext *convert_ctx = NULL;
-+#else
-+	void *convert_ctx = NULL;
- #endif
- 	int max_dst_nb_samples = 0, dst_linsize = 0;
- 	uint8_t *dst_data[1] = { NULL };
-@@ -75,6 +77,7 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name
- 		goto done;
- 	}
- 
-+#if defined(HAVE_SWRESAMPLE) || defined(HAVE_AVRESAMPLE)
- 	if (codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
- 		int64_t channel_layout = codec_ctx->channel_layout;
- 		if (!channel_layout) {
-@@ -111,6 +114,7 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name
- 		}
- #endif
- 	}
-+#endif
- 
- 	if (stream->duration != AV_NOPTS_VALUE) {
- 		*duration = stream->time_base.num * stream->duration / stream->time_base.den;
-@@ -155,10 +159,11 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name
- 						max_dst_nb_samples = frame->nb_samples;
- 					}
- #if defined(HAVE_SWRESAMPLE)
--					if (swr_convert(convert_ctx, dst_data, frame->nb_samples, (const uint8_t **)frame->data, frame->nb_samples) < 0) {
-+					if (swr_convert(convert_ctx, dst_data, frame->nb_samples, (const uint8_t **)frame->data, frame->nb_samples) < 0)
- #elif defined(HAVE_AVRESAMPLE)
--					if (avresample_convert(convert_ctx, dst_data, 0, frame->nb_samples, (uint8_t **)frame->data, 0, frame->nb_samples) < 0) {
-+					if (avresample_convert(convert_ctx, dst_data, 0, frame->nb_samples, (uint8_t **)frame->data, 0, frame->nb_samples) < 0)
- #endif
-+					{
- 						fprintf(stderr, "ERROR: couldn't convert the audio\n");
- 						goto done;
- 					}
--- 
-1.9.rc2.211.gd198f5d
-


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

* [gentoo-commits] repo/gentoo:master commit in: media-libs/chromaprint/, media-libs/chromaprint/files/
@ 2018-05-13 12:18 Sergei Trofimovich
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Trofimovich @ 2018-05-13 12:18 UTC (permalink / raw
  To: gentoo-commits

commit:     7aa820ae52e5b028eca2b0364add30cb7440b54b
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Thu Apr 19 20:52:38 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun May 13 12:17:56 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7aa820ae

media-libs/chromaprint-1.4.3: add new version

Closes: https://bugs.gentoo.org/653548
Package-Manager: Portage-2.3.24, Repoman-2.3.6
RepoMan-Options: --include-arches="sparc"
Closes: https://github.com/gentoo/gentoo/pull/8077

 media-libs/chromaprint/Manifest                    |  1 +
 media-libs/chromaprint/chromaprint-1.4.3.ebuild    | 50 ++++++++++++++++++
 .../files/chromaprint-1.4.3-test-bigendian.patch   | 60 ++++++++++++++++++++++
 3 files changed, 111 insertions(+)

diff --git a/media-libs/chromaprint/Manifest b/media-libs/chromaprint/Manifest
index 7cd57c19a74..2dda794d0e0 100644
--- a/media-libs/chromaprint/Manifest
+++ b/media-libs/chromaprint/Manifest
@@ -2,4 +2,5 @@ DIST chromaprint-1.2.tar.gz 529646 BLAKE2B a45b88edfe7e37bc09d960a385f8b7303705d
 DIST chromaprint-1.3.2.tar.gz 538395 BLAKE2B b08d6ff106c3728d91352e694d39722390500480bb5049298150de198593116def213445d5cd96772d3956508df80b92ce3b440c14606aeff8eeca934aa402de SHA512 7f89eb09f293a3691efcb01544da612cf674a00af1c188db3f1075db44fee0a8e0aeff3ca6eccd0731ae6bbff9eb0fd51b22128fa927fdbd21638e2832f76e95
 DIST chromaprint-1.4.1.tar.gz 611014 BLAKE2B 139a3d58392f442feab1d955b03accb5ec81df3cb3de43a9a1d53d7ce061cee94aaad4ce66a860326fa84f155eba39e50e34a7055522e0637cacee8c91e7f7e7 SHA512 9d414ba01be87f973df877afc600c761bf338292680d2626baa2a483f0bb681b506d02baa8f9de297489459ba1ebae9005202bfe7ba661b7bd4d60d4a2463ede
 DIST chromaprint-1.4.2.tar.gz 613367 BLAKE2B ffec54c952a35f8f5bf6bc74b5d58339af3f0ffc0a0c0e88ee5e864e9112ad96cced629dcb8422f5e74aca3c48f93f7fa153cc6aabf0659a4e90416c34f34e43 SHA512 69449adf1c95c1395a5545d36877afe95b409d045357cc675e9ac58aee2955b3a9a245f37805192804a9b7fddc792b9e9289bf6448fa3393131048d28e06d7e2
+DIST chromaprint-1.4.3.tar.gz 613741 BLAKE2B 728f08e14c46a36d98c3a32a7c7a221a48b51561b623a403d9bee6aeea5cb5254866da26d50db0dbc5b0b4ceddb8312d52a8aab4c2979709bd2c8221b9e84d0f SHA512 101360bd643d2410fafcdd4aef8fe4c716ec728f0e4b9b3a62ba125fe010b0315e55a1839a2ca8c29d9abfbf8171560b23d68b732e75632ce8f4a4698f77ea72
 DIST gtest-1.8.0.tar.gz 1281617 BLAKE2B ac052b4d0eb0d8ded03a8c7dff05177818627b8a51f2dbc2c162b2ee2a5d1323539e7d0d02236d9ebb799995e018f0171c2fdaeb4de3bb339548265e50de79e6 SHA512 1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d

diff --git a/media-libs/chromaprint/chromaprint-1.4.3.ebuild b/media-libs/chromaprint/chromaprint-1.4.3.ebuild
new file mode 100644
index 00000000000..c1ac357af58
--- /dev/null
+++ b/media-libs/chromaprint/chromaprint-1.4.3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-multilib
+
+GTEST_VERSION="1.8.0"
+
+DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
+HOMEPAGE="http://acoustid.org/chromaprint"
+SRC_URI="https://github.com/acoustid/${PN}/releases/download/v${PV}/${P}.tar.gz
+	test? (	https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz -> gtest-${GTEST_VERSION}.tar.gz )
+"
+
+LICENSE="LGPL-2.1"
+SLOT="0/1"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd"
+IUSE="libav test tools"
+
+# note: use ffmpeg or libav instead of fftw because it's recommended and required for tools
+RDEPEND="
+	libav? ( >=media-video/libav-11:0=[${MULTILIB_USEDEP}] )
+	!libav? ( >=media-video/ffmpeg-2.6:0=[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}
+	test? (
+		dev-cpp/gtest[${MULTILIB_USEDEP}]
+		dev-libs/boost[${MULTILIB_USEDEP}]
+	)"
+
+PATCHES=( "${FILESDIR}"/chromaprint-1.4.3-test-bigendian.patch )
+
+DOCS="NEWS.txt README.md"
+
+S=${WORKDIR}/${PN}-v${PV}
+
+multilib_src_configure() {
+	export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VERSION}/googletest/"
+	local mycmakeargs=(
+		"-DBUILD_TOOLS=$(multilib_native_usex tools ON OFF)"
+		"-DBUILD_TESTS=$(usex test ON OFF)"
+		-DFFT_LIB=avfft
+		-DAUDIO_PROCESSOR_LIB=$(usex libav avresample swresample)
+		)
+	cmake-utils_src_configure
+}
+
+multilib_src_test() {
+	emake check
+}

diff --git a/media-libs/chromaprint/files/chromaprint-1.4.3-test-bigendian.patch b/media-libs/chromaprint/files/chromaprint-1.4.3-test-bigendian.patch
new file mode 100644
index 00000000000..dc080bb9847
--- /dev/null
+++ b/media-libs/chromaprint/files/chromaprint-1.4.3-test-bigendian.patch
@@ -0,0 +1,60 @@
+From 8d5f2ca81db8fae6b59b6b9b8bda91526507dbd1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lukas@oxygene.sk>
+Date: Sat, 10 Feb 2018 06:52:10 +0100
+Subject: [PATCH] Change LoadAudioFile to not depend on little-endian CPU
+
+Fixes https://github.com/acoustid/chromaprint/issues/46
+---
+ tests/test_utils.cpp |  9 +++++++++
+ tests/test_utils.h   | 14 +++++++++-----
+ 2 files changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_utils.cpp b/tests/test_utils.cpp
+index fc8bb86..536f46e 100644
+--- a/tests/test_utils.cpp
++++ b/tests/test_utils.cpp
+@@ -2,6 +2,7 @@
+ #include <algorithm>
+ #include <limits>
+ #include "utils.h"
++#include "test_utils.h"
+ 
+ using namespace chromaprint;
+ 
+@@ -92,3 +93,11 @@ TEST(Utils, CountSetBits64) {
+     EXPECT_EQ(64, CountSetBits(0xFFFFFFFFFFFFFFFFU));
+     EXPECT_EQ(8, CountSetBits(0x0101010101010101U));
+ }
++
++TEST(Utils, LoadAudioFile) {
++	std::vector<short> data = LoadAudioFile("data/test_mono_44100.raw");
++	ASSERT_EQ(data.size(), 176400/2);
++	EXPECT_EQ(data[1000], 0);
++	EXPECT_EQ(data[2000], 107);
++	EXPECT_EQ(data[3000], 128);
++}
+diff --git a/tests/test_utils.h b/tests/test_utils.h
+index 3631007..d01e9e3 100644
+--- a/tests/test_utils.h
++++ b/tests/test_utils.h
+@@ -31,11 +31,15 @@ inline std::vector<short> LoadAudioFile(const std::string &file_name)
+ {
+ 	std::string path = TESTS_DIR + file_name;
+ 	std::ifstream file(path.c_str(), std::ifstream::in | std::ifstream::binary);
+-	file.seekg(0, std::ios::end);
+-	int length = file.tellg();
+-	file.seekg(0, std::ios::beg);
+-	std::vector<short> data(length / 2);
+-	file.read((char *)&data[0], length);
++	uint8_t buf[4096];
++	std::vector<int16_t> data;
++	while (!file.eof()) {
++		file.read((char *) buf, 4096);
++		size_t nread = file.gcount();
++		for (size_t i = 0; i < nread - 1; i += 2) {
++			data.push_back((int16_t) (((uint16_t) buf[i+1] << 8) | ((uint16_t) buf[i])));
++		}
++	}
+ 	file.close();
+ 	return data;
+ }


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

* [gentoo-commits] repo/gentoo:master commit in: media-libs/chromaprint/, media-libs/chromaprint/files/
@ 2018-06-06  8:13 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2018-06-06  8:13 UTC (permalink / raw
  To: gentoo-commits

commit:     da9c5d029470980f27b81473e25016d5aa4bf7c6
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  3 13:18:51 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Jun  6 08:06:42 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da9c5d02

media-libs/chromaprint: Drop old

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 media-libs/chromaprint/Manifest                    |   3 -
 media-libs/chromaprint/chromaprint-1.2-r1.ebuild   |  42 ---------
 media-libs/chromaprint/chromaprint-1.2.ebuild      |  47 ----------
 media-libs/chromaprint/chromaprint-1.3.2.ebuild    |  42 ---------
 media-libs/chromaprint/chromaprint-1.4.1.ebuild    |  46 ---------
 .../chromaprint/files/chromaprint-1.1-gtest.patch  | 104 ---------------------
 .../files/chromaprint-1.2-ffmpeg29.patch           |  48 ----------
 7 files changed, 332 deletions(-)

diff --git a/media-libs/chromaprint/Manifest b/media-libs/chromaprint/Manifest
index 2dda794d0e0..78d7e8f7527 100644
--- a/media-libs/chromaprint/Manifest
+++ b/media-libs/chromaprint/Manifest
@@ -1,6 +1,3 @@
-DIST chromaprint-1.2.tar.gz 529646 BLAKE2B a45b88edfe7e37bc09d960a385f8b7303705da9cc717c85f707b6ea3ed2f2f288589850461ab368ef5a9873239d058416757c5f7fd524d0e240b14145e3aa07e SHA512 dc61db8894a20df3d7e7317cd7cd97148c19be5854dd66409341cb8e47c045e1c632b254e14a869279983a5af2cc6f9effea21b77a63dff729511e6144439cbb
-DIST chromaprint-1.3.2.tar.gz 538395 BLAKE2B b08d6ff106c3728d91352e694d39722390500480bb5049298150de198593116def213445d5cd96772d3956508df80b92ce3b440c14606aeff8eeca934aa402de SHA512 7f89eb09f293a3691efcb01544da612cf674a00af1c188db3f1075db44fee0a8e0aeff3ca6eccd0731ae6bbff9eb0fd51b22128fa927fdbd21638e2832f76e95
-DIST chromaprint-1.4.1.tar.gz 611014 BLAKE2B 139a3d58392f442feab1d955b03accb5ec81df3cb3de43a9a1d53d7ce061cee94aaad4ce66a860326fa84f155eba39e50e34a7055522e0637cacee8c91e7f7e7 SHA512 9d414ba01be87f973df877afc600c761bf338292680d2626baa2a483f0bb681b506d02baa8f9de297489459ba1ebae9005202bfe7ba661b7bd4d60d4a2463ede
 DIST chromaprint-1.4.2.tar.gz 613367 BLAKE2B ffec54c952a35f8f5bf6bc74b5d58339af3f0ffc0a0c0e88ee5e864e9112ad96cced629dcb8422f5e74aca3c48f93f7fa153cc6aabf0659a4e90416c34f34e43 SHA512 69449adf1c95c1395a5545d36877afe95b409d045357cc675e9ac58aee2955b3a9a245f37805192804a9b7fddc792b9e9289bf6448fa3393131048d28e06d7e2
 DIST chromaprint-1.4.3.tar.gz 613741 BLAKE2B 728f08e14c46a36d98c3a32a7c7a221a48b51561b623a403d9bee6aeea5cb5254866da26d50db0dbc5b0b4ceddb8312d52a8aab4c2979709bd2c8221b9e84d0f SHA512 101360bd643d2410fafcdd4aef8fe4c716ec728f0e4b9b3a62ba125fe010b0315e55a1839a2ca8c29d9abfbf8171560b23d68b732e75632ce8f4a4698f77ea72
 DIST gtest-1.8.0.tar.gz 1281617 BLAKE2B ac052b4d0eb0d8ded03a8c7dff05177818627b8a51f2dbc2c162b2ee2a5d1323539e7d0d02236d9ebb799995e018f0171c2fdaeb4de3bb339548265e50de79e6 SHA512 1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d

diff --git a/media-libs/chromaprint/chromaprint-1.2-r1.ebuild b/media-libs/chromaprint/chromaprint-1.2-r1.ebuild
deleted file mode 100644
index 81b0bbafac9..00000000000
--- a/media-libs/chromaprint/chromaprint-1.2-r1.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-inherit cmake-multilib
-
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
-HOMEPAGE="https://acoustid.org/chromaprint"
-SRC_URI="https://bitbucket.org/acoustid/${PN}/downloads/${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~x86 ~amd64-fbsd"
-IUSE="libav test tools"
-
-# note: use ffmpeg or libav instead of fftw because it's recommended and required for tools
-RDEPEND="
-	libav? ( >=media-video/libav-11:0=[${MULTILIB_USEDEP}] )
-	!libav? ( >=media-video/ffmpeg-2.6:0=[${MULTILIB_USEDEP}] )
-"
-DEPEND="${RDEPEND}
-	test? (
-		dev-cpp/gtest[${MULTILIB_USEDEP}]
-		dev-libs/boost[${MULTILIB_USEDEP}]
-	)"
-
-DOCS="NEWS.txt README.md"
-
-PATCHES=( "${FILESDIR}"/${PN}-1.1-gtest.patch "${FILESDIR}"/${P}-ffmpeg29.patch )
-
-multilib_src_configure() {
-	local mycmakeargs=(
-		"-DBUILD_EXAMPLES=$(multilib_native_usex tools ON OFF)"
-		"-DBUILD_TESTS=$(usex test ON OFF)"
-		-DWITH_AVFFT=ON
-		)
-	cmake-utils_src_configure
-}
-
-multilib_src_test() {
-	emake check
-}

diff --git a/media-libs/chromaprint/chromaprint-1.2.ebuild b/media-libs/chromaprint/chromaprint-1.2.ebuild
deleted file mode 100644
index e6bff8e5479..00000000000
--- a/media-libs/chromaprint/chromaprint-1.2.ebuild
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-inherit cmake-utils
-
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
-HOMEPAGE="https://acoustid.org/chromaprint"
-SRC_URI="https://bitbucket.org/acoustid/${PN}/downloads/${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~ppc ~ppc64 x86 ~amd64-fbsd"
-IUSE="libav test tools"
-
-# note: use ffmpeg or libav instead of fftw because it's recommended and required for tools
-RDEPEND="
-	libav? ( media-video/libav:0= )
-	!libav? ( >=media-video/ffmpeg-2.6:0= )
-"
-DEPEND="${RDEPEND}
-	test? (
-		dev-cpp/gtest
-		dev-libs/boost
-	)"
-
-DOCS="NEWS.txt README.md"
-
-PATCHES=( "${FILESDIR}"/${PN}-1.1-gtest.patch "${FILESDIR}"/${P}-ffmpeg29.patch )
-
-src_configure() {
-	local mycmakeargs=(
-		$(cmake-utils_use_build tools EXAMPLES)
-		$(cmake-utils_use_build test TESTS)
-		-DWITH_AVFFT=ON
-		)
-	cmake-utils_src_configure
-}
-
-src_test() {
-	cd "${BUILD_DIR}" || die
-	emake check
-}
-
-src_install() {
-	cmake-utils_src_install
-}

diff --git a/media-libs/chromaprint/chromaprint-1.3.2.ebuild b/media-libs/chromaprint/chromaprint-1.3.2.ebuild
deleted file mode 100644
index dcff5eb696a..00000000000
--- a/media-libs/chromaprint/chromaprint-1.3.2.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit cmake-multilib
-
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
-HOMEPAGE="https://acoustid.org/chromaprint"
-SRC_URI="https://bitbucket.org/acoustid/${PN}/downloads/${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0/1"
-KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~x86 ~amd64-fbsd"
-IUSE="libav test tools"
-
-# note: use ffmpeg or libav instead of fftw because it's recommended and required for tools
-RDEPEND="
-	libav? ( >=media-video/libav-11:0=[${MULTILIB_USEDEP}] )
-	!libav? ( >=media-video/ffmpeg-2.6:0=[${MULTILIB_USEDEP}] )
-"
-DEPEND="${RDEPEND}
-	test? (
-		dev-cpp/gtest[${MULTILIB_USEDEP}]
-		dev-libs/boost[${MULTILIB_USEDEP}]
-	)"
-
-DOCS="NEWS.txt README.md"
-
-PATCHES=( "${FILESDIR}"/${PN}-1.1-gtest.patch )
-
-multilib_src_configure() {
-	local mycmakeargs=(
-		"-DBUILD_EXAMPLES=$(multilib_native_usex tools ON OFF)"
-		"-DBUILD_TESTS=$(usex test ON OFF)"
-		-DWITH_AVFFT=ON
-		)
-	cmake-utils_src_configure
-}
-
-multilib_src_test() {
-	emake check
-}

diff --git a/media-libs/chromaprint/chromaprint-1.4.1.ebuild b/media-libs/chromaprint/chromaprint-1.4.1.ebuild
deleted file mode 100644
index 102d01c254b..00000000000
--- a/media-libs/chromaprint/chromaprint-1.4.1.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit cmake-multilib
-
-GTEST_VERSION="1.8.0"
-
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
-HOMEPAGE="https://acoustid.org/chromaprint"
-SRC_URI="https://bitbucket.org/acoustid/${PN}/downloads/${P}.tar.gz
-	test? (	https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz -> gtest-${GTEST_VERSION}.tar.gz )
-"
-
-LICENSE="LGPL-2.1"
-SLOT="0/1"
-KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~x86 ~amd64-fbsd"
-IUSE="libav test tools"
-
-# note: use ffmpeg or libav instead of fftw because it's recommended and required for tools
-RDEPEND="
-	libav? ( >=media-video/libav-11:0=[${MULTILIB_USEDEP}] )
-	!libav? ( >=media-video/ffmpeg-2.6:0=[${MULTILIB_USEDEP}] )
-"
-DEPEND="${RDEPEND}
-	test? (
-		dev-cpp/gtest[${MULTILIB_USEDEP}]
-		dev-libs/boost[${MULTILIB_USEDEP}]
-	)"
-
-DOCS="NEWS.txt README.md"
-
-multilib_src_configure() {
-	export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VERSION}/googletest/"
-	local mycmakeargs=(
-		"-DBUILD_TOOLS=$(multilib_native_usex tools ON OFF)"
-		"-DBUILD_TESTS=$(usex test ON OFF)"
-		-DFFT_LIB=avfft
-		-DAUDIO_PROCESSOR_LIB=$(usex libav avresample swresample)
-		)
-	cmake-utils_src_configure
-}
-
-multilib_src_test() {
-	emake check
-}

diff --git a/media-libs/chromaprint/files/chromaprint-1.1-gtest.patch b/media-libs/chromaprint/files/chromaprint-1.1-gtest.patch
deleted file mode 100644
index 8305ae7c1af..00000000000
--- a/media-libs/chromaprint/files/chromaprint-1.1-gtest.patch
+++ /dev/null
@@ -1,104 +0,0 @@
- cmake/modules/FindGTest.cmake | 82 -------------------------------------------
- tests/CMakeLists.txt          |  1 -
- 2 files changed, 83 deletions(-)
-
-diff --git a/cmake/modules/FindGTest.cmake b/cmake/modules/FindGTest.cmake
-deleted file mode 100644
-index 21dc2f5..0000000
---- a/cmake/modules/FindGTest.cmake
-+++ /dev/null
-@@ -1,82 +0,0 @@
--# Locate the Google C++ Testing Framework source directory.
--#
--# Defines the following variables:
--#
--#   GTEST_FOUND - Found the Google Testing framework sources
--#   GTEST_INCLUDE_DIRS - Include directories
--#   GTEST_SOURCE_DIR - Source code directory
--#   GTEST_LIBRARIES - libgtest
--#   GTEST_MAIN_LIBRARIES - libgtest-main
--#   GTEST_BOTH_LIBRARIES - libgtest & libgtest-main
--#
--# Accepts the following variables as input:
--#
--#   GTEST_ROOT - (as CMake or environment variable)
--#                The root directory of the gtest install prefix
--#
--# Example usage:
--#
--#    find_package(GTest REQUIRED)
--#    include_directories(${GTEST_INCLUDE_DIRS})
--#    add_subdirectory(${GTEST_SOURCE_DIR}
--#        ${CMAKE_CURRENT_BINARY_DIR}/gtest_build)
--#
--#    add_executable(foo foo.cc)
--#    target_link_libraries(foo ${GTEST_BOTH_LIBRARIES})
--#
--#    enable_testing(true)
--#    add_test(AllTestsInFoo foo)
--#
--# =========================================================
--#
--# Copyright (C) 2012 Lukas Lalinsky <lalinsky@gmail.com>
--#
--# Redistribution and use in source and binary forms, with or without
--# modification, are permitted provided that the following conditions are
--# met:
--#
--#  * Redistributions of source code must retain the above copyright notice,
--#    this list of conditions and the following disclaimer.
--#
--#  * Redistributions in binary form must reproduce the above copyright notice,
--#    this list of conditions and the following disclaimer in the documentation
--#    and/or other materials provided with the distribution.
--#
--#  * The names of Kitware, Inc., the Insight Consortium, or the names of
--#    any consortium members, or of any contributors, may not be used to
--#    endorse or promote products derived from this software without
--#    specific prior written permission.
--#
--# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
--# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
--# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
--# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
--# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
--# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
--# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
--# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
--# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
--# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
--
--find_path(GTEST_SOURCE_DIR
--	NAMES src/gtest-all.cc CMakeLists.txt
--	HINTS $ENV{GTEST_ROOT} ${GTEST_ROOT} /usr/src/gtest
--)
--mark_as_advanced(GTEST_SOURCE_DIR)
--
--find_path(GTEST_INCLUDE_DIR
--	NAMES gtest/gtest.h
--	HINTS $ENV{GTEST_ROOT}/include ${GTEST_ROOT}/include
--)
--mark_as_advanced(GTEST_INCLUDE_DIR)
--
--include(FindPackageHandleStandardArgs)
--find_package_handle_standard_args(GTest DEFAULT_MSG GTEST_SOURCE_DIR GTEST_INCLUDE_DIR)
--
--if(GTEST_FOUND)
--	set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
--	set(GTEST_LIBRARIES gtest)
--	set(GTEST_MAIN_LIBRARIES gtest_main)
--    set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
--endif()
-diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
-index 791cd96..9115391 100644
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -3,7 +3,6 @@ include_directories(
- 	${Boost_INCLUDE_DIRS}
- 	${CMAKE_CURRENT_SOURCE_DIR}/../src
- )
--add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/gtest_build)
- 
- set(tests_SOURCES
- 	main.cpp

diff --git a/media-libs/chromaprint/files/chromaprint-1.2-ffmpeg29.patch b/media-libs/chromaprint/files/chromaprint-1.2-ffmpeg29.patch
deleted file mode 100644
index 6910f243b2e..00000000000
--- a/media-libs/chromaprint/files/chromaprint-1.2-ffmpeg29.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-commit 37092d380a28abcc63fa120499030a0f2b7df80f
-Author: Rodger Combs <rodger.combs@gmail.com>
-Date:   Fri Oct 2 14:48:01 2015 -0500
-
-    fpcalc: remove uses of deprecated lavc APIs
-
-Index: chromaprint-1.2/examples/fpcalc.c
-===================================================================
---- chromaprint-1.2.orig/examples/fpcalc.c
-+++ chromaprint-1.2/examples/fpcalc.c
-@@ -17,10 +17,6 @@
- #define MAX(a, b) ((a) > (b) ? (a) : (b))
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
- 
--#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 28, 0)
--#define avcodec_free_frame av_freep
--#endif
--
- int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name, int max_length, int *duration)
- {
- 	int ok = 0, remaining, length, consumed, codec_ctx_opened = 0, got_frame, stream_index;
-@@ -131,7 +127,7 @@ int decode_audio_file(ChromaprintContext
- 	remaining = max_length * codec_ctx->channels * codec_ctx->sample_rate;
- 	chromaprint_start(chromaprint_ctx, codec_ctx->sample_rate, codec_ctx->channels);
- 
--	frame = avcodec_alloc_frame();
-+	frame = av_frame_alloc();
- 
- 	while (1) {
- 		if (av_read_frame(format_ctx, &packet) < 0) {
-@@ -139,7 +135,7 @@ int decode_audio_file(ChromaprintContext
- 		}
- 
- 		if (packet.stream_index == stream_index) {
--			avcodec_get_frame_defaults(frame);
-+			av_frame_unref(frame);
- 
- 			got_frame = 0;
- 			consumed = avcodec_decode_audio4(codec_ctx, frame, &got_frame, &packet);
-@@ -196,7 +192,7 @@ finish:
- 
- done:
- 	if (frame) {
--		avcodec_free_frame(&frame);
-+		av_frame_free(&frame);
- 	}
- 	if (dst_data[0]) {
- 		av_freep(&dst_data[0]);


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

* [gentoo-commits] repo/gentoo:master commit in: media-libs/chromaprint/, media-libs/chromaprint/files/
@ 2019-11-24 13:04 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2019-11-24 13:04 UTC (permalink / raw
  To: gentoo-commits

commit:     4d0edf6808391ca6ae5c8df9efbeeec0bfd48ba7
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 24 12:58:32 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Nov 24 13:04:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d0edf68

media-libs/chromaprint: EAPI-7 bump, fix DEPENDs and DESCRIPTION

CMake improvements.

Closes: https://bugs.gentoo.org/625300
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 media-libs/chromaprint/chromaprint-1.4.3.ebuild    | 28 +++++------
 .../files/chromaprint-1.4.3-cmake.patch            | 58 ++++++++++++++++++++++
 2 files changed, 72 insertions(+), 14 deletions(-)

diff --git a/media-libs/chromaprint/chromaprint-1.4.3.ebuild b/media-libs/chromaprint/chromaprint-1.4.3.ebuild
index 169011a15e1..4b0533b5d9f 100644
--- a/media-libs/chromaprint/chromaprint-1.4.3.ebuild
+++ b/media-libs/chromaprint/chromaprint-1.4.3.ebuild
@@ -1,15 +1,15 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
-inherit cmake-multilib
+EAPI=7
 
 GTEST_VERSION="1.8.0"
+inherit cmake-multilib
 
-DESCRIPTION="A client-side library that implements a custom algorithm for extracting fingerprints"
+DESCRIPTION="Library implementing a custom algorithm for extracting audio fingerprints"
 HOMEPAGE="https://acoustid.org/chromaprint"
 SRC_URI="https://github.com/acoustid/${PN}/releases/download/v${PV}/${P}.tar.gz
-	test? (	https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz -> gtest-${GTEST_VERSION}.tar.gz )
+	test? ( https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz -> gtest-${GTEST_VERSION}.tar.gz )
 "
 
 LICENSE="LGPL-2.1"
@@ -23,25 +23,25 @@ RDEPEND="
 	!libav? ( >=media-video/ffmpeg-2.6:0=[${MULTILIB_USEDEP}] )
 "
 DEPEND="${RDEPEND}
-	test? (
-		dev-cpp/gtest[${MULTILIB_USEDEP}]
-		dev-libs/boost[${MULTILIB_USEDEP}]
-	)"
+	test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"
 
-PATCHES=( "${FILESDIR}"/chromaprint-1.4.3-test-bigendian.patch )
+PATCHES=(
+	"${FILESDIR}"/${P}-test-bigendian.patch
+	"${FILESDIR}"/${P}-cmake.patch
+)
 
-DOCS="NEWS.txt README.md"
+DOCS=( NEWS.txt README.md )
 
-S=${WORKDIR}/${PN}-v${PV}
+S="${WORKDIR}/${PN}-v${PV}"
 
 multilib_src_configure() {
 	export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VERSION}/googletest/"
 	local mycmakeargs=(
-		"-DBUILD_TOOLS=$(multilib_native_usex tools ON OFF)"
-		"-DBUILD_TESTS=$(usex test ON OFF)"
+		-DBUILD_TOOLS=$(multilib_native_usex tools ON OFF)
+		-DBUILD_TESTS=$(usex test ON OFF)
 		-DFFT_LIB=avfft
 		-DAUDIO_PROCESSOR_LIB=$(usex libav avresample swresample)
-		)
+	)
 	cmake-utils_src_configure
 }
 

diff --git a/media-libs/chromaprint/files/chromaprint-1.4.3-cmake.patch b/media-libs/chromaprint/files/chromaprint-1.4.3-cmake.patch
new file mode 100644
index 00000000000..60fe548cf29
--- /dev/null
+++ b/media-libs/chromaprint/files/chromaprint-1.4.3-cmake.patch
@@ -0,0 +1,58 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3991219..f9e172b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,21 +1,11 @@
+-cmake_minimum_required(VERSION 2.8.12)
+-
+-if(POLICY CMP0042)
+-	cmake_policy(SET CMP0042 NEW)
+-endif()
+-
+-if(POLICY CMP0048)
+-    cmake_policy(SET CMP0048 OLD)
+-endif()
+-
+-project(chromaprint C CXX)
++cmake_minimum_required(VERSION 3.3)
+ 
+ set(chromaprint_VERSION_MAJOR 1)
+ set(chromaprint_VERSION_MINOR 4)
+ set(chromaprint_VERSION_PATCH 3)
+ set(chromaprint_VERSION "${chromaprint_VERSION_MAJOR}.${chromaprint_VERSION_MINOR}.${chromaprint_VERSION_PATCH}")
+ 
+-set(PROJECT_VERSION "${chromaprint_VERSION}")
++project(chromaprint LANGUAGES C CXX VERSION "${chromaprint_VERSION}")
+ 
+ set(chromaprint_SOVERSION 1)
+ 
+@@ -31,14 +21,14 @@ include(CheckCXXCompilerFlag)
+ 
+ find_package(Threads)
+ 
+-check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
+-if(COMPILER_SUPPORTS_CXX11)
+-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+-endif()
++option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+ 
+-if(CMAKE_COMPILER_IS_GNUCXX AND BUILD_SHARED_LIBS)
+-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
++set(CMAKE_CXX_STANDARD 11)
++
++if(BUILD_SHARED_LIBS)
++	set(CMAKE_C_VISIBILITY_PRESET hidden)
++	set(CMAKE_CXX_VISIBILITY_PRESET hidden)
++	set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
+ endif()
+ 
+ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
+@@ -70,7 +60,6 @@ if(APPLE)
+ 	set(FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING "Directory to install frameworks to")
+ endif()
+ 
+-option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+ option(BUILD_TOOLS "Build command line tools" OFF)
+ option(BUILD_TESTS "Build test suite" OFF)
+ 


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

* [gentoo-commits] repo/gentoo:master commit in: media-libs/chromaprint/, media-libs/chromaprint/files/
@ 2023-06-13 14:31 Jason A. Donenfeld
  0 siblings, 0 replies; 5+ messages in thread
From: Jason A. Donenfeld @ 2023-06-13 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     a096ce621790b5bd832d267044e4b50119242a3a
Author:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 13 14:29:20 2023 +0000
Commit:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Tue Jun 13 14:30:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a096ce62

media-libs/chromaprint: add 1.5.1-r3 for ffmpeg-5 support

Closes: https://bugs.gentoo.org/884393
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>

 media-libs/chromaprint/chromaprint-1.5.1-r3.ebuild |  52 ++
 media-libs/chromaprint/files/ffmpeg-5.patch        | 580 +++++++++++++++++++++
 2 files changed, 632 insertions(+)

diff --git a/media-libs/chromaprint/chromaprint-1.5.1-r3.ebuild b/media-libs/chromaprint/chromaprint-1.5.1-r3.ebuild
new file mode 100644
index 000000000000..c18875469243
--- /dev/null
+++ b/media-libs/chromaprint/chromaprint-1.5.1-r3.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GTEST_VERSION="1.10.0"
+GTEST_DIR_VERSION="1.10.x"
+inherit cmake-multilib
+
+DESCRIPTION="Library implementing a custom algorithm for extracting audio fingerprints"
+HOMEPAGE="https://acoustid.org/chromaprint"
+SRC_URI="https://github.com/acoustid/${PN}/releases/download/v${PV}/${P}.tar.gz
+	test? ( https://github.com/google/googletest/archive/v$(ver_cut 1-2 ${GTEST_VERSION}).x.tar.gz -> gtest-${GTEST_VERSION}.tar.gz )
+"
+
+LICENSE="LGPL-2.1"
+SLOT="0/1"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="test tools"
+RESTRICT="!test? ( test )"
+
+# - Default to fftw to avoid awkward circular dependency w/ ffmpeg
+# See bug #833821 for an example
+RDEPEND="tools? ( >=media-video/ffmpeg-5:=[${MULTILIB_USEDEP}] )
+	!tools? ( sci-libs/fftw:=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"
+
+DOCS=( NEWS.txt README.md )
+PATCHES=( "${FILESDIR}"/ffmpeg-5.patch )
+
+multilib_src_configure() {
+	export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_DIR_VERSION}/googletest/"
+
+	local mycmakeargs=(
+		-DBUILD_TESTS=$(usex test)
+
+		-DBUILD_TOOLS=$(multilib_native_usex tools)
+		-DFFT_LIB=$(usex tools 'avfft' 'fftw3')
+		$(multilib_native_usex tools '-DAUDIO_PROCESSOR_LIB=swresample' '')
+		# Automagicallyish looks for ffmpeg, but there's no point
+		# even doing the check unless we're building with tools
+		# (=> without fftw3, and with ffmpeg).
+		-DCMAKE_DISABLE_FIND_PACKAGE_FFmpeg=$(multilib_native_usex !tools)
+	)
+
+	cmake_src_configure
+}
+
+multilib_src_test() {
+	cd tests && (./all_tests || die "Tests failed")
+}

diff --git a/media-libs/chromaprint/files/ffmpeg-5.patch b/media-libs/chromaprint/files/ffmpeg-5.patch
new file mode 100644
index 000000000000..a88ce7204f73
--- /dev/null
+++ b/media-libs/chromaprint/files/ffmpeg-5.patch
@@ -0,0 +1,580 @@
+From 8ccad6937177b1b92e40ab8f4447ea27bac009a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= <lalinsky@gmail.com>
+Date: Fri, 4 Nov 2022 21:47:38 +0100
+Subject: [PATCH] Use FFmpeg 5.x (#120)
+
+* Use FFmpeg 5.1.2 for CI builds
+
+* Build on Ubuntu 20.04
+
+* Upgrade code to FFmpeg 5.x APIs
+
+* Only set FFmpeg include dirs if building tools
+
+* No longer needed
+
+* Use ubuntu 20.04
+---
+ .github/workflows/build.yml                   |   6 +-
+ CMakeLists.txt                                |  16 --
+ src/audio/ffmpeg_audio_processor.h            |   2 -
+ src/audio/ffmpeg_audio_processor_avresample.h |  72 -------
+ src/audio/ffmpeg_audio_processor_swresample.h |  18 +-
+ src/audio/ffmpeg_audio_reader.h               | 197 +++++++++---------
+ tests/CMakeLists.txt                          |   6 +
+ 8 files changed, 122 insertions(+), 199 deletions(-)
+ delete mode 100644 src/audio/ffmpeg_audio_processor_avresample.h
+
+diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
+index 92761d9..baf67b7 100644
+--- a/.github/workflows/build.yml
++++ b/.github/workflows/build.yml
+@@ -6,7 +6,7 @@ on:
+ 
+ jobs:
+   test-linux:
+-    runs-on: ubuntu-18.04
++    runs-on: ubuntu-20.04
+     strategy:
+       matrix:
+         fft:
+@@ -50,7 +50,7 @@ jobs:
+         make check VERBOSE=1
+ 
+   package-linux:
+-    runs-on: ubuntu-18.04
++    runs-on: ubuntu-20.04
+     strategy:
+       matrix:
+         arch:
+@@ -71,7 +71,7 @@ jobs:
+         path: artifacts/
+ 
+   package-windows:
+-    runs-on: ubuntu-18.04
++    runs-on: ubuntu-20.04
+     strategy:
+       matrix:
+         arch:
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8d6a32..4da2405 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -84,9 +84,6 @@ find_package(FFmpeg)
+ if(FFMPEG_LIBRARIES)
+ 	cmake_push_check_state(RESET)
+ 	set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -lm)
+-	check_function_exists(av_packet_unref HAVE_AV_PACKET_UNREF)
+-	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
+-	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
+ 	cmake_pop_check_state()
+ endif()
+ 
+@@ -163,14 +160,11 @@ message(STATUS "Using ${FFT_LIB} for FFT calculations")
+ if(NOT AUDIO_PROCESSOR_LIB)
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+ 		set(AUDIO_PROCESSOR_LIB "swresample")
+-	elseif(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(AUDIO_PROCESSOR_LIB "avresample")
+ 	endif()
+ endif()
+ 
+ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 	if(FFMPEG_LIBSWRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE OFF)
+ 		set(USE_SWRESAMPLE ON)
+ 		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+ 		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS})
+@@ -178,16 +172,6 @@ if(AUDIO_PROCESSOR_LIB STREQUAL "swresample")
+ 		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+ 	endif()
+ 	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+-elseif(AUDIO_PROCESSOR_LIB STREQUAL "avresample")
+-	if(FFMPEG_LIBAVRESAMPLE_FOUND)
+-		set(USE_AVRESAMPLE ON)
+-		set(USE_SWRESAMPLE OFF)
+-		set(AUDIO_PROCESSOR_LIBRARIES ${FFMPEG_LIBAVRESAMPLE_LIBRARIES})
+-		set(AUDIO_PROCESSOR_INCLUDE_DIRS ${FFMPEG_LIBAVRESAMPLE_INCLUDE_DIRS})
+-	else()
+-		message(FATAL_ERROR "Selected ${AUDIO_PROCESSOR_LIB} for audio processing, but the library is not found")
+-	endif()
+-	message(STATUS "Using ${AUDIO_PROCESSOR_LIB} for audio conversion")
+ else()
+ 	message(STATUS "Building without audio conversion support, please install FFmpeg with libswresample")
+ endif()
+diff --git a/src/audio/ffmpeg_audio_processor.h b/src/audio/ffmpeg_audio_processor.h
+index 7628fc7..39f4f6d 100644
+--- a/src/audio/ffmpeg_audio_processor.h
++++ b/src/audio/ffmpeg_audio_processor.h
+@@ -10,8 +10,6 @@
+ 
+ #if defined(USE_SWRESAMPLE)
+ #include "audio/ffmpeg_audio_processor_swresample.h"
+-#elif defined(USE_AVRESAMPLE)
+-#include "audio/ffmpeg_audio_processor_avresample.h"
+ #else
+ #error "no audio processing library"
+ #endif
+diff --git a/src/audio/ffmpeg_audio_processor_avresample.h b/src/audio/ffmpeg_audio_processor_avresample.h
+deleted file mode 100644
+index bd85f92..0000000
+--- a/src/audio/ffmpeg_audio_processor_avresample.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-// Copyright (C) 2016  Lukas Lalinsky
+-// Distributed under the MIT license, see the LICENSE file for details.
+-
+-#ifndef CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-#define CHROMAPRINT_AUDIO_FFMPEG_AUDIO_PROCESSOR_AVRESAMPLE_H_
+-
+-extern "C" {
+-#include <libavresample/avresample.h>
+-}
+-
+-namespace chromaprint {
+-
+-class FFmpegAudioProcessor {
+-public:
+-	FFmpegAudioProcessor() {
+-		m_resample_ctx = avresample_alloc_context();
+-	}
+-
+-	~FFmpegAudioProcessor() {
+-		avresample_free(&m_resample_ctx);
+-	}
+-
+-	void SetCompatibleMode() {
+-		av_opt_set_int(m_resample_ctx, "filter_size", 16, 0);
+-		av_opt_set_int(m_resample_ctx, "phase_shift", 8, 0);
+-		av_opt_set_int(m_resample_ctx, "linear_interp", 1, 0);
+-		av_opt_set_double(m_resample_ctx, "cutoff", 0.8, 0);
+-	}
+-
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "in_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "in_sample_rate", sample_rate, 0);
+-	}
+-
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_resample_ctx, "out_channel_layout", channel_layout, 0);
+-	}
+-
+-	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_format, 0);
+-	}
+-
+-	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_resample_ctx, "out_sample_fmt", sample_rate, 0);
+-	}
+-
+-	int Init() {
+-		return avresample_open(m_resample_ctx);
+-	}
+-
+-	int Convert(uint8_t **out, int out_count, const uint8_t **in, int in_count) {
+-		return avresample_convert(m_resample_ctx, out, 0, out_count, (uint8_t **) in, 0, in_count);
+-	}
+-
+-	int Flush(uint8_t **out, int out_count) {
+-		return avresample_read(m_resample_ctx, out, out_count);
+-	}
+-
+-private:
+-	AVAudioResampleContext *m_resample_ctx = nullptr;
+-};
+-
+-}; // namespace chromaprint
+-
+-#endif
+diff --git a/src/audio/ffmpeg_audio_processor_swresample.h b/src/audio/ffmpeg_audio_processor_swresample.h
+index b86266b..b1d4bea 100644
+--- a/src/audio/ffmpeg_audio_processor_swresample.h
++++ b/src/audio/ffmpeg_audio_processor_swresample.h
+@@ -28,30 +28,28 @@ class FFmpegAudioProcessor {
+ 		av_opt_set_double(m_swr_ctx, "cutoff", 0.8, 0);
+ 	}
+ 
+-	void SetInputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "icl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "ich", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetInputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "in_channel_layout", channel_layout->u.mask, 0);
+ 	}
+ 
+ 	void SetInputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "isf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "in_sample_fmt", sample_format, 0);
+ 	}
+ 
+ 	void SetInputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "isr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "in_sample_rate", sample_rate, 0);
+ 	}
+ 
+-	void SetOutputChannelLayout(int64_t channel_layout) {
+-		av_opt_set_int(m_swr_ctx, "ocl", channel_layout, 0);
+-		av_opt_set_int(m_swr_ctx, "och", av_get_channel_layout_nb_channels(channel_layout), 0);
++	void SetOutputChannelLayout(AVChannelLayout *channel_layout) {
++		av_opt_set_int(m_swr_ctx, "out_channel_layout", channel_layout->u.mask, 0);
+ 	}
+ 
+ 	void SetOutputSampleFormat(AVSampleFormat sample_format) {
+-		av_opt_set_int(m_swr_ctx, "osf", sample_format, 0);
++		av_opt_set_sample_fmt(m_swr_ctx, "out_sample_fmt", sample_format, 0);
+ 	}
+ 
+ 	void SetOutputSampleRate(int sample_rate) {
+-		av_opt_set_int(m_swr_ctx, "osr", sample_rate, 0);
++		av_opt_set_int(m_swr_ctx, "out_sample_rate", sample_rate, 0);
+ 	}
+ 
+ 	int Init() {
+diff --git a/src/audio/ffmpeg_audio_reader.h b/src/audio/ffmpeg_audio_reader.h
+index 5550164..1c6b346 100644
+--- a/src/audio/ffmpeg_audio_reader.h
++++ b/src/audio/ffmpeg_audio_reader.h
+@@ -62,7 +62,7 @@ class FFmpegAudioReader {
+ 	bool Read(const int16_t **data, size_t *size);
+ 
+ 	bool IsOpen() const { return m_opened; }
+-	bool IsFinished() const { return m_finished && !m_got_frame; }
++	bool IsFinished() const { return !m_has_more_packets && !m_has_more_frames; }
+ 
+ 	std::string GetError() const { return m_error; }
+ 	int GetErrorCode() const { return m_error_code; }
+@@ -74,20 +74,19 @@ class FFmpegAudioReader {
+ 	uint8_t *m_convert_buffer[1] = { nullptr };
+ 	int m_convert_buffer_nb_samples = 0;
+ 
+-	AVInputFormat *m_input_fmt = nullptr;
++	const AVInputFormat *m_input_fmt = nullptr;
+ 	AVDictionary *m_input_opts = nullptr;
+ 
+ 	AVFormatContext *m_format_ctx = nullptr;
+ 	AVCodecContext *m_codec_ctx = nullptr;
+-	AVFrame *m_frame = nullptr;
+ 	int m_stream_index = -1;
+ 	std::string m_error;
+ 	int m_error_code = 0;
+-	bool m_finished = false;
+ 	bool m_opened = false;
+-	int m_got_frame = 0;
+-	AVPacket m_packet;
+-	AVPacket m_packet0;
++	bool m_has_more_packets = true;
++	bool m_has_more_frames = true;
++	AVPacket *m_packet = nullptr;
++	AVFrame *m_frame = nullptr;
+ 
+ 	int m_output_sample_rate = 0;
+ 	int m_output_channels = 0;
+@@ -98,19 +97,12 @@ class FFmpegAudioReader {
+ 
+ inline FFmpegAudioReader::FFmpegAudioReader() {
+ 	av_log_set_level(AV_LOG_QUIET);
+-
+-	av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
+ }
+ 
+ inline FFmpegAudioReader::~FFmpegAudioReader() {
+ 	Close();
+ 	av_dict_free(&m_input_opts);
+ 	av_freep(&m_convert_buffer[0]);
+-	av_packet_unref(&m_packet0);
+ }
+ 
+ inline bool FFmpegAudioReader::SetInputFormat(const char *name) {
+@@ -135,11 +127,10 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 
+ 	Close();
+ 
+-    av_init_packet(&m_packet);
+-	m_packet.data = nullptr;
+-	m_packet.size = 0;
+-
+-	m_packet0 = m_packet;
++	m_packet = av_packet_alloc();
++	if (!m_packet) {
++		return false;
++	}
+ 
+ 	ret = avformat_open_input(&m_format_ctx, file_name.c_str(), m_input_fmt, &m_input_opts);
+ 	if (ret < 0) {
+@@ -153,26 +144,31 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		return false;
+ 	}
+ 
+-	AVCodec *codec;
++	const AVCodec *codec;
+ 	ret = av_find_best_stream(m_format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
+ 	if (ret < 0) {
+ 		SetError("Could not find any audio stream in the file", ret);
+ 		return false;
+ 	}
+ 	m_stream_index = ret;
++	auto stream = m_format_ctx->streams[m_stream_index];
+ 
+-	m_codec_ctx = m_format_ctx->streams[m_stream_index]->codec;
++	m_codec_ctx = avcodec_alloc_context3(codec);
+ 	m_codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
+ 
++	ret = avcodec_parameters_to_context(m_codec_ctx, stream->codecpar);
++	if (ret < 0) {
++		SetError("Could not copy the stream parameters", ret);
++		return false;
++	}
++
+ 	ret = avcodec_open2(m_codec_ctx, codec, nullptr);
+ 	if (ret < 0) {
+ 		SetError("Could not open the codec", ret);
+ 		return false;
+ 	}
+ 
+-	if (!m_codec_ctx->channel_layout) {
+-		m_codec_ctx->channel_layout = av_get_default_channel_layout(m_codec_ctx->channels);
+-	}
++	av_dump_format(m_format_ctx, 0, "foo", 0);
+ 
+ 	m_frame = av_frame_alloc();
+ 	if (!m_frame) {
+@@ -183,19 +179,23 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		m_output_sample_rate = m_codec_ctx->sample_rate;
+ 	}
+ 
+-	if (!m_output_channels) {
+-		m_output_channels = m_codec_ctx->channels;
++	AVChannelLayout output_channel_layout;
++	if (m_output_channels) {
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
++	} else {
++		m_output_channels = m_codec_ctx->ch_layout.nb_channels;
++		av_channel_layout_default(&output_channel_layout, m_output_channels);
+ 	}
+ 
+-	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
++	if (m_codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16 || m_codec_ctx->ch_layout.nb_channels != m_output_channels || m_codec_ctx->sample_rate != m_output_sample_rate) {
+ 		m_converter.reset(new FFmpegAudioProcessor());
+ 		m_converter->SetCompatibleMode();
+ 		m_converter->SetInputSampleFormat(m_codec_ctx->sample_fmt);
+ 		m_converter->SetInputSampleRate(m_codec_ctx->sample_rate);
+-		m_converter->SetInputChannelLayout(m_codec_ctx->channel_layout);
++		m_converter->SetInputChannelLayout(&(m_codec_ctx->ch_layout));
+ 		m_converter->SetOutputSampleFormat(AV_SAMPLE_FMT_S16);
+ 		m_converter->SetOutputSampleRate(m_output_sample_rate);
+-		m_converter->SetOutputChannelLayout(av_get_default_channel_layout(m_output_channels));
++		m_converter->SetOutputChannelLayout(&output_channel_layout);
+ 		auto ret = m_converter->Init();
+ 		if (ret != 0) {
+ 			SetError("Could not create an audio converter instance", ret);
+@@ -203,10 +203,11 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 		}
+ 	}
+ 
++	av_channel_layout_uninit(&output_channel_layout);
++
+ 	m_opened = true;
+-	m_finished = false;
+-	m_got_frame = 0;
+-	m_nb_packets = 0;
++	m_has_more_packets = true;
++	m_has_more_frames = true;
+ 	m_decode_error = 0;
+ 
+ 	return true;
+@@ -214,6 +215,7 @@ inline bool FFmpegAudioReader::Open(const std::string &file_name) {
+ 
+ inline void FFmpegAudioReader::Close() {
+ 	av_frame_free(&m_frame);
++	av_packet_free(&m_packet);
+ 
+ 	m_stream_index = -1;
+ 
+@@ -252,91 +254,98 @@ inline bool FFmpegAudioReader::Read(const int16_t **data, size_t *size) {
+ 		return false;
+ 	}
+ 
++	*data = nullptr;
++	*size = 0;
++
+ 	int ret;
++	bool needs_packet = false;
+ 	while (true) {
+-		while (m_packet.size <= 0) {
+-			av_packet_unref(&m_packet0);
+-			av_init_packet(&m_packet);
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			ret = av_read_frame(m_format_ctx, &m_packet);
++		while (needs_packet && m_packet->size == 0) {
++			ret = av_read_frame(m_format_ctx, m_packet);
+ 			if (ret < 0) {
+ 				if (ret == AVERROR_EOF) {
+-					m_finished = true;
++					needs_packet = false;
++					m_has_more_packets = false;
+ 					break;
+-				} else {
++				}
++				SetError("Error reading from the audio source", ret);
++				return false;
++			}
++			if (m_packet->stream_index == m_stream_index) {
++				needs_packet = false;
++			} else {
++				av_packet_unref(m_packet);
++			}
++		}
++
++		if (m_packet->size != 0) {
++			ret = avcodec_send_packet(m_codec_ctx, m_packet);
++			if (ret < 0) {
++				if (ret != AVERROR(EAGAIN)) {
+ 					SetError("Error reading from the audio source", ret);
+ 					return false;
+ 				}
+-			}
+-			m_packet0 = m_packet;
+-			if (m_packet.stream_index != m_stream_index) {
+-				m_packet.data = nullptr;
+-				m_packet.size = 0;
+ 			} else {
+-				m_nb_packets++;
++				av_packet_unref(m_packet);
+ 			}
+ 		}
+ 
+-		ret = avcodec_decode_audio4(m_codec_ctx, m_frame, &m_got_frame, &m_packet);
++		ret = avcodec_receive_frame(m_codec_ctx, m_frame);
+ 		if (ret < 0) {
+-			if (m_decode_error) {
+-				SetError("Error decoding audio frame", m_decode_error);
+-				return false;
++			if (ret == AVERROR_EOF) {
++				m_has_more_frames = false;
++			} else if (ret == AVERROR(EAGAIN)) {
++				if (m_has_more_packets) {
++					needs_packet = true;
++					continue;
++				} else {
++					m_has_more_frames = false;
++				}
+ 			}
+-			m_decode_error = ret;
+-			m_packet.data = nullptr;
+-			m_packet.size = 0;
+-			continue;
++			SetError("Error decoding the audio source", ret);
++			return false;
+ 		}
+ 
+-		break;
+-	}
+-
+-	m_decode_error = 0;
+-
+-	const int decoded = std::min(ret, m_packet.size);
+-	m_packet.data += decoded;
+-	m_packet.size -= decoded;
+-
+-	if (m_got_frame) {
+-		if (m_converter) {
+-			if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
+-				int linsize;
+-				av_freep(&m_convert_buffer[0]);
+-				m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
+-				ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
+-				if (ret < 0) {
+-					SetError("Couldn't allocate audio converter buffer", ret);
++		if (m_frame->nb_samples > 0) {
++			if (m_converter) {
++				if (m_frame->nb_samples > m_convert_buffer_nb_samples) {
++					int linsize;
++					av_freep(&m_convert_buffer[0]);
++					m_convert_buffer_nb_samples = std::max(1024 * 8, m_frame->nb_samples);
++					ret = av_samples_alloc(m_convert_buffer, &linsize, m_codec_ctx->ch_layout.nb_channels, m_convert_buffer_nb_samples, AV_SAMPLE_FMT_S16, 1);
++					if (ret < 0) {
++						SetError("Couldn't allocate audio converter buffer", ret);
++						return false;
++					}
++				}
++				auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
++				if (nb_samples < 0) {
++					SetError("Couldn't convert audio", ret);
+ 					return false;
+ 				}
+-			}
+-			auto nb_samples = m_converter->Convert(m_convert_buffer, m_convert_buffer_nb_samples, (const uint8_t **) m_frame->data, m_frame->nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			}
+-			*data = (const int16_t *) m_convert_buffer[0];
+-			*size = nb_samples;
+-		} else {
+-			*data = (const int16_t *) m_frame->data[0];
+-			*size = m_frame->nb_samples;
+-		}
+-	} else {
+-		if (m_finished && m_converter) {
+-			auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
+-			if (nb_samples < 0) {
+-				SetError("Couldn't convert audio", ret);
+-				return false;
+-			} else if (nb_samples > 0) {
+-				m_got_frame = 1;
+ 				*data = (const int16_t *) m_convert_buffer[0];
+ 				*size = nb_samples;
++			} else {
++				*data = (const int16_t *) m_frame->data[0];
++				*size = m_frame->nb_samples;
++			}
++		} else {
++			if (m_converter) {
++				if (IsFinished()) {
++					auto nb_samples = m_converter->Flush(m_convert_buffer, m_convert_buffer_nb_samples);
++					if (nb_samples < 0) {
++						SetError("Couldn't convert audio", ret);
++						return false;
++					} else if (nb_samples > 0) {
++						*data = (const int16_t *) m_convert_buffer[0];
++						*size = nb_samples;
++					}
++				}
+ 			}
+ 		}
+-	}
+ 
+-	return true;
++		return true;
++	}
+ }
+ 
+ inline void FFmpegAudioReader::SetError(const char *message, int errnum) {
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index a2b517b..123e643 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -38,6 +38,12 @@ set(SRCS
+ 
+ if(BUILD_TOOLS)
+ 	set(SRCS ${SRCS} ../src/audio/ffmpeg_audio_reader_test.cpp)
++    include_directories(
++        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
++        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
++        ${AUDIO_PROCESSOR_INCLUDE_DIRS}
++    )
+ 	link_libraries(fpcalc_libs)
+ endif()
+ 


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

end of thread, other threads:[~2023-06-13 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-13 12:18 [gentoo-commits] repo/gentoo:master commit in: media-libs/chromaprint/, media-libs/chromaprint/files/ Sergei Trofimovich
  -- strict thread matches above, loose matches on Subject: below --
2023-06-13 14:31 Jason A. Donenfeld
2019-11-24 13:04 Andreas Sturmlechner
2018-06-06  8:13 Andreas Sturmlechner
2015-10-30 14:45 Alexis Ballier

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