forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
media-sound/clementine: Fixed building against >=media-libs/chromapri…
…nt-1.4 This fixes Gentoo bug #603662 Package-Manager: Portage-2.3.3, Repoman-2.3.1
- Loading branch information
Lars Wendler
committed
Dec 26, 2016
1 parent
48ec80c
commit 38d0e53
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
media-sound/clementine/files/clementine-chromaprint14.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From ded312685735fc266d4154d355286eeb86db3bcd Mon Sep 17 00:00:00 2001 | ||
From: Chocobozzz <[email protected]> | ||
Date: Thu, 8 Dec 2016 23:12:17 +0100 | ||
Subject: [PATCH] Add compatibility with chromaprint >= 1.4 | ||
|
||
--- | ||
src/musicbrainz/chromaprinter.cpp | 14 +++++++++++--- | ||
1 file changed, 11 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/src/musicbrainz/chromaprinter.cpp b/src/musicbrainz/chromaprinter.cpp | ||
index 9579b62..c7ad99e 100644 | ||
--- a/src/musicbrainz/chromaprinter.cpp | ||
+++ b/src/musicbrainz/chromaprinter.cpp | ||
@@ -143,16 +143,24 @@ QString Chromaprinter::CreateFingerprint() { | ||
ChromaprintContext* chromaprint = | ||
chromaprint_new(CHROMAPRINT_ALGORITHM_DEFAULT); | ||
chromaprint_start(chromaprint, kDecodeRate, kDecodeChannels); | ||
- chromaprint_feed(chromaprint, reinterpret_cast<void*>(data.data()), | ||
+ chromaprint_feed(chromaprint, reinterpret_cast<int16_t *>(data.data()), | ||
data.size() / 2); | ||
chromaprint_finish(chromaprint); | ||
|
||
- void* fprint = nullptr; | ||
int size = 0; | ||
+ | ||
+#if CHROMAPRINT_VERSION_MAJOR >= 1 && CHROMAPRINT_VERSION_MINOR >= 4 | ||
+ u_int32_t *fprint = nullptr; | ||
+ char *encoded = nullptr; | ||
+#else | ||
+ void *fprint = nullptr; | ||
+ void *encoded = nullptr; | ||
+#endif | ||
+ | ||
int ret = chromaprint_get_raw_fingerprint(chromaprint, &fprint, &size); | ||
+ | ||
QByteArray fingerprint; | ||
if (ret == 1) { | ||
- void* encoded = nullptr; | ||
int encoded_size = 0; | ||
chromaprint_encode_fingerprint(fprint, size, CHROMAPRINT_ALGORITHM_DEFAULT, | ||
&encoded, &encoded_size, 1); |