diff -Nru chromaprint-1.4.3/CMakeLists.txt chromaprint-1.4.4+git-20190610.1839652/CMakeLists.txt --- chromaprint-1.4.3/CMakeLists.txt 2018-01-21 16:41:56.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/CMakeLists.txt 2019-06-10 12:35:48.000000000 +0000 @@ -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_PATCH 4) 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 @@ 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 @@ 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) diff -Nru chromaprint-1.4.3/debian/changelog chromaprint-1.4.4+git-20190610.1839652/debian/changelog --- chromaprint-1.4.3/debian/changelog 2018-02-07 12:09:30.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/debian/changelog 2019-08-14 01:36:34.000000000 +0000 @@ -1,3 +1,47 @@ +chromaprint (1.4.4+git-20190610.1839652-1ppa1) bionic; urgency=medium + + * Update to 1.4.4 with upstream latest commit. + + -- Hung-Yi Chen Wed, 14 Aug 2019 09:36:34 +0800 + +chromaprint (1.4.3-3ppa1~bionic) bionic; urgency=medium + + * Backport from Eoan. + + -- Hung-Yi Chen Mon, 22 Jul 2019 02:08:32 +0800 + +chromaprint (1.4.3-3) unstable; urgency=medium + + [ Edward Betts ] + * Correct github source URL. + + [ Sebastian Ramacher ] + * debian/control: + - Bump Standards-Version. + - Remove obsolete Pre-Depends. + - Use Python 3 version of docutils. + * debian/: + - Apply upstream patch to fix tests on big endian platforms. (Closes: + #889815) + - Bump debhelper compat to 12. + + -- Sebastian Ramacher Sat, 05 Jan 2019 13:31:33 +0100 + +chromaprint (1.4.3-2) unstable; urgency=medium + + [ Ondřej Nový ] + * d/changelog: Remove trailing whitespaces + + [ Felipe Sateler ] + * Change maintainer address to debian-multimedia@lists.debian.org + + [ Sebastian Ramacher ] + * debian/control: + - Bump Standards-Version. + - Mark libchromaprint-dev as M-A: same. + + -- Sebastian Ramacher Sat, 12 May 2018 14:38:49 +0200 + chromaprint (1.4.3-1) unstable; urgency=medium * New upstream release. @@ -167,7 +211,7 @@ - Pass the LIB_SUFFIX flag to cmake pointing to the multiarch directories. * Change debian/copyright format to DEP5. * Specify the copyright information for the ffmpeg headers in examples/. - * Disable DH_VERBOSE debug output + * Disable DH_VERBOSE debug output * Add lintian override for the use of libchromaprint-private in libchromaprint0.symbols in order to prevent linking against the C++ STL symbols. diff -Nru chromaprint-1.4.3/debian/compat chromaprint-1.4.4+git-20190610.1839652/debian/compat --- chromaprint-1.4.3/debian/compat 2018-02-07 08:57:29.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/debian/compat 2019-08-14 01:35:13.000000000 +0000 @@ -1 +1 @@ -11 +10 diff -Nru chromaprint-1.4.3/debian/control chromaprint-1.4.4+git-20190610.1839652/debian/control --- chromaprint-1.4.3/debian/control 2018-02-07 09:06:35.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/debian/control 2019-08-14 01:35:13.000000000 +0000 @@ -1,18 +1,18 @@ Source: chromaprint Priority: optional -Maintainer: Debian Multimedia Maintainers +Maintainer: Debian Multimedia Maintainers Uploaders: Sebastian Ramacher , Reinhard Tartler Build-Depends: cmake, - debhelper (>= 11), + debhelper (>= 10), libavcodec-dev, libavformat-dev, libgtest-dev, libswresample-dev, - python-docutils (>= 0.6) -Standards-Version: 4.1.3 + python3-docutils (>= 0.6) +Standards-Version: 4.1.4 Section: libs Homepage: https://acoustid.org/chromaprint Vcs-Git: https://salsa.debian.org/multimedia-team/chromaprint.git @@ -21,6 +21,7 @@ Package: libchromaprint-dev Section: libdevel Architecture: any +Multi-Arch: same Depends: libchromaprint1 (= ${binary:Version}), ${misc:Depends} @@ -35,7 +36,6 @@ Package: libchromaprint1 Architecture: any Multi-Arch: same -Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} diff -Nru chromaprint-1.4.3/debian/copyright chromaprint-1.4.4+git-20190610.1839652/debian/copyright --- chromaprint-1.4.3/debian/copyright 2018-02-07 12:01:48.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/debian/copyright 2019-08-14 01:35:13.000000000 +0000 @@ -1,6 +1,6 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: chromaprint -Source: https://github.org/acoustid/chromaprint +Source: https://github.com/acoustid/chromaprint Files: * Copyright: 2010-2012 Lukáš Lalinský diff -Nru chromaprint-1.4.3/debian/rules chromaprint-1.4.4+git-20190610.1839652/debian/rules --- chromaprint-1.4.3/debian/rules 2018-02-07 11:53:40.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/debian/rules 2019-08-14 01:35:13.000000000 +0000 @@ -2,19 +2,15 @@ # -*- makefile -*- # export DH_VERBOSE=1 -include /usr/share/dpkg/architecture.mk - export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed CONFIGURE_FLAGS = -DBUILD_TOOLS=ON CONFIGURE_FLAGS += -DBUILD_SHARED_LIBS=ON CONFIGURE_FLAGS += -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" -ifeq (little,$(DEB_HOST_ARCH_ENDIAN)) ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) CONFIGURE_FLAGS += -DBUILD_TESTS=ON endif -endif %: dh $@ diff -Nru chromaprint-1.4.3/.github/FUNDING.yml chromaprint-1.4.4+git-20190610.1839652/.github/FUNDING.yml --- chromaprint-1.4.3/.github/FUNDING.yml 1970-01-01 00:00:00.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/.github/FUNDING.yml 2019-06-10 12:35:48.000000000 +0000 @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: acoustid +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: https://acoustid.org/donate diff -Nru chromaprint-1.4.3/NEWS.txt chromaprint-1.4.4+git-20190610.1839652/NEWS.txt --- chromaprint-1.4.3/NEWS.txt 2018-01-21 16:41:56.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/NEWS.txt 2019-06-10 12:35:48.000000000 +0000 @@ -1,4 +1,14 @@ -Version 1.4.3 -- January 21, 2017 +Version 1.5.0 -- UNRELEASED +=========================== + + - Add support for fpcalc -raw -signed, which helps with easier PostgreSQL integration + +Version 1.4.4 -- February 10, 2018 +================================== + + - Fix unit tests on big endian CPUs + +Version 1.4.3 -- January 21, 2018 ================================== - Allow one packet to have decoding error diff -Nru chromaprint-1.4.3/README.md chromaprint-1.4.4+git-20190610.1839652/README.md --- chromaprint-1.4.3/README.md 2018-01-21 16:41:56.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/README.md 2019-06-10 12:35:48.000000000 +0000 @@ -91,7 +91,9 @@ * [C#](https://github.com/wo80/AcoustID.NET) (reimplementation) * [C#](https://github.com/protyposis/Aurio/tree/master/Aurio/Aurio/Matching/Chromaprint) (reimplementation) * [Pascal](https://github.com/CMCHTPC/ChromaPrint) (reimplementation) + * [Scala/JVM](https://github.com/mgdigital/Chromaprint.scala) (reimplementation) * [C++/CLI](https://github.com/CyberSinh/Luminescence.Audio) + * [Vala](https://github.com/GNOME/vala-extra-vapis/blob/master/libchromaprint.vapi) Integrations: diff -Nru chromaprint-1.4.3/src/chromaprint.h chromaprint-1.4.4+git-20190610.1839652/src/chromaprint.h --- chromaprint-1.4.3/src/chromaprint.h 2018-01-21 16:41:56.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/src/chromaprint.h 2019-06-10 12:35:48.000000000 +0000 @@ -84,7 +84,7 @@ #define CHROMAPRINT_VERSION_MAJOR 1 #define CHROMAPRINT_VERSION_MINOR 4 -#define CHROMAPRINT_VERSION_PATCH 3 +#define CHROMAPRINT_VERSION_PATCH 4 enum ChromaprintAlgorithm { CHROMAPRINT_ALGORITHM_TEST1 = 0, diff -Nru chromaprint-1.4.3/src/cmd/fpcalc.cpp chromaprint-1.4.4+git-20190610.1839652/src/cmd/fpcalc.cpp --- chromaprint-1.4.3/src/cmd/fpcalc.cpp 2018-01-21 16:41:56.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/src/cmd/fpcalc.cpp 2019-06-10 12:35:48.000000000 +0000 @@ -27,6 +27,7 @@ static double g_max_chunk_duration = 0; static bool g_overlap = false; static bool g_raw = false; +static bool g_signed = false; static bool g_abs_ts = false; static bool g_ignore_errors = false; static ChromaprintAlgorithm g_algorithm = CHROMAPRINT_ALGORITHM_DEFAULT; @@ -47,6 +48,7 @@ " -overlap Overlap the chunks slightly to make sure audio on the edges is fingerprinted\n" " -ts Output UNIX timestamps for chunked results, useful when fingerprinting real-time audio stream\n" " -raw Output fingerprints in the uncompressed format\n" + " -signed Change the uncompressed format from unsigned integers to signed (for pg_acoustid compatibility)\n" " -json Print the output in JSON format\n" " -text Print the output in text format\n" " -plain Print the just the fingerprint in text format\n" @@ -119,10 +121,17 @@ g_abs_ts = true; } else if (!strcmp(argv[i], "-raw")) { g_raw = true; + } else if (!strcmp(argv[i], "-signed")) { + g_signed = true; } else if (!strcmp(argv[i], "-ignore-errors")) { g_ignore_errors = true; } else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "-version")) { - fprintf(stdout, "fpcalc version %s\n", chromaprint_get_version()); +#if defined(USE_SWRESAMPLE) +#define RESAMPLE_LIB_IDENT_IDENT LIBSWRESAMPLE_IDENT +#else +#define RESAMPLE_LIB_IDENT_IDENT LIBAVRESAMPLE_IDENT +#endif + fprintf(stdout, "fpcalc version %s (FFmpeg %s %s %s)\n", chromaprint_get_version(), LIBAVCODEC_IDENT, LIBAVFORMAT_IDENT, RESAMPLE_LIB_IDENT_IDENT); exit(0); } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-help") || !strcmp(argv[i], "--help")) { fprintf(stdout, g_help, argv[0]); @@ -175,7 +184,11 @@ if (i > 0) { ss << ','; } - ss << raw_fp_data[i]; + if (g_signed) { + ss << static_cast(raw_fp_data[i]); + } else { + ss << raw_fp_data[i]; + } } tmp_fp = ss.str(); fp = tmp_fp.c_str(); diff -Nru chromaprint-1.4.3/tests/test_utils.cpp chromaprint-1.4.4+git-20190610.1839652/tests/test_utils.cpp --- chromaprint-1.4.3/tests/test_utils.cpp 2018-01-21 16:41:56.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/tests/test_utils.cpp 2019-06-10 12:35:48.000000000 +0000 @@ -2,6 +2,7 @@ #include #include #include "utils.h" +#include "test_utils.h" using namespace chromaprint; @@ -92,3 +93,11 @@ EXPECT_EQ(64, CountSetBits(0xFFFFFFFFFFFFFFFFU)); EXPECT_EQ(8, CountSetBits(0x0101010101010101U)); } + +TEST(Utils, LoadAudioFile) { + std::vector 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 -Nru chromaprint-1.4.3/tests/test_utils.h chromaprint-1.4.4+git-20190610.1839652/tests/test_utils.h --- chromaprint-1.4.3/tests/test_utils.h 2018-01-21 16:41:56.000000000 +0000 +++ chromaprint-1.4.4+git-20190610.1839652/tests/test_utils.h 2019-06-10 12:35:48.000000000 +0000 @@ -31,11 +31,15 @@ { 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 data(length / 2); - file.read((char *)&data[0], length); + uint8_t buf[4096]; + std::vector 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; }