1
0
mirror of https://github.com/dguglielmi/sunny-overlay.git synced 2025-12-06 22:32:37 +01:00
Files
sunny-overlay/media-sound/mixxx/files/mixxx-2.0.0-chromaprint-1.4.patch
David Guglielmi 09a17d9652 - media-sound/mixxx: re-add mixxx to fix Qt5 issues
Mixxx is compiled with Qt5 in ~gx86 and some core features are broken
with Qt5, so we need to backport those following patches.

- https://github.com/mixxxdj/mixxx/pull/845/commits
- https://github.com/mixxxdj/mixxx/pull/848/commits
2017-02-04 22:53:00 +01:00

41 lines
1.5 KiB
Diff

Backported chromaprint-1.4 API changes based on the fix suggested in:
https://github.com/mixxxdj/mixxx/pull/1073
and the work done by Charlie Gehlin in:
https://bugs.gentoo.org/604528
--- mixxx-2.0.0/src/musicbrainz/chromaprinter.cpp
+++ mixxx-2.0.0/src/musicbrainz/chromaprinter.cpp
@@ -25,6 +25,16 @@
QString ChromaPrinter::calcFingerPrint(const Mixxx::SoundSourcePointer& pSoundSource) {
+ // Type declarations of *fprint and *encoded pointers need to account for Chromaprint API version
+ // (void* -> uint32_t*) and (void* -> char*) changed in versions v1.4.0 or later -- alyptik 12/2016
+ #if (CHROMAPRINT_VERSION_MINOR > 3) || (CHROMAPRINT_VERSION_MAJOR > 1)
+ typedef uint32_t* uint32_p;
+ typedef char* char_p;
+ #else
+ typedef void* uint32_p;
+ typedef void* char_p;
+ #endif
+
// this is worth 2min of audio, multiply by 2 because we have 2 channels
// AcoustID only stores a fingerprint for the first two minutes of a song
// on their server so we need only a fingerprint of the first two minutes
@@ -57,12 +67,12 @@
}
chromaprint_finish(ctx);
- void* fprint = NULL;
+ uint32_p fprint = NULL;
int size = 0;
int ret = chromaprint_get_raw_fingerprint(ctx, &fprint, &size);
QByteArray fingerprint;
if (ret == 1) {
- void* encoded = NULL;
+ char_p encoded = NULL;
int encoded_size = 0;
chromaprint_encode_fingerprint(fprint, size,
CHROMAPRINT_ALGORITHM_DEFAULT,