Update chromaprint to 1.5.0

Input from cwen@ and sthen@, ok sthen@. Thanks
This commit is contained in:
rsadowski 2020-11-17 06:17:24 +00:00
parent 4bd1f87d11
commit be061f93dc
4 changed files with 5 additions and 63 deletions

View File

@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.13 2019/08/23 20:18:04 cwen Exp $
# $OpenBSD: Makefile,v 1.14 2020/11/17 06:17:24 rsadowski Exp $
COMMENT = audio fingerprint extraction library
GH_ACCOUNT = acoustid
GH_PROJECT = chromaprint
GH_TAGNAME = v1.4.3
GH_TAGNAME = v1.5.0
SHARED_LIBS = chromaprint 2.0 # 1.4.3
SHARED_LIBS = chromaprint 3.0 # 1.5.0
CATEGORIES = audio devel

View File

@ -1,2 +1,2 @@
SHA256 (chromaprint-1.4.3.tar.gz) = 1K5llig6rXoBWlsERQEgVMY0pLkynssjAAzTVLQKKDs=
SIZE (chromaprint-1.4.3.tar.gz) = 613718
SHA256 (chromaprint-1.5.0.tar.gz) = XI4NV5yzR4kAaZEQqpYcFVKkIqGHQc9n3WITaxuHfHs=
SIZE (chromaprint-1.5.0.tar.gz) = 615221

View File

@ -1,29 +0,0 @@
$OpenBSD: patch-tests_test_utils_cpp,v 1.1 2019/08/23 20:18:04 cwen Exp $
Make tests endian neutral. Can be removed with chromaprint>=1.4.4:
https://github.com/acoustid/chromaprint/commit/8d5f2ca81db8fae6b59b6b9b8bda91526507dbd1
Index: tests/test_utils.cpp
--- tests/test_utils.cpp.orig
+++ tests/test_utils.cpp
@@ -2,6 +2,7 @@
#include <algorithm>
#include <limits>
#include "utils.h"
+#include "test_utils.h"
using namespace chromaprint;
@@ -91,4 +92,12 @@ TEST(Utils, CountSetBits64) {
EXPECT_EQ(56, CountSetBits(0xFFFFFFFFFFFFFFU));
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);
}

View File

@ -1,29 +0,0 @@
$OpenBSD: patch-tests_test_utils_h,v 1.1 2019/08/23 20:18:04 cwen Exp $
Make tests endian neutral. Can be removed with chromaprint>=1.4.4:
https://github.com/acoustid/chromaprint/commit/8d5f2ca81db8fae6b59b6b9b8bda91526507dbd1
Index: tests/test_utils.h
--- tests/test_utils.h.orig
+++ tests/test_utils.h
@@ -31,11 +31,15 @@ inline std::vector<short> LoadAudioFile(const std::str
{
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;
}