1 |
ssuominen 14/02/10 16:47:48 |
2 |
|
3 |
Added: chromaprint-1.1-libav_build_fix_for_tools.patch |
4 |
Log: |
5 |
Apply upstream patch from bug 498194 to fix build with certain versions of media-video/libav wrt #498194 by Laurent Bachelier |
6 |
|
7 |
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 4868F14D) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 media-libs/chromaprint/files/chromaprint-1.1-libav_build_fix_for_tools.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/chromaprint/files/chromaprint-1.1-libav_build_fix_for_tools.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/chromaprint/files/chromaprint-1.1-libav_build_fix_for_tools.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: chromaprint-1.1-libav_build_fix_for_tools.patch |
16 |
=================================================================== |
17 |
http://bugs.gentoo.org/498194 |
18 |
http://bitbucket.org/acoustid/chromaprint/commits/90822f6eee64da2941c9cbd9cd41a9664fead1d4 |
19 |
|
20 |
From 90822f6eee64da2941c9cbd9cd41a9664fead1d4 Mon Sep 17 00:00:00 2001 |
21 |
From: Urs Fleisch <ufleisch@×××××××××××××××××.net> |
22 |
Date: Sat, 28 Dec 2013 09:47:31 +0100 |
23 |
Subject: [PATCH] Build fpcalc if neither HAVE_SWRESAMPLE nor HAVE_AVRESAMPLE |
24 |
defined, issue #11. |
25 |
|
26 |
--- |
27 |
examples/fpcalc.c | 9 +++++++-- |
28 |
1 file changed, 7 insertions(+), 2 deletions(-) |
29 |
|
30 |
diff --git a/examples/fpcalc.c b/examples/fpcalc.c |
31 |
index a4b0ff9..e73e358 100644 |
32 |
--- a/examples/fpcalc.c |
33 |
+++ b/examples/fpcalc.c |
34 |
@@ -33,6 +33,8 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name |
35 |
SwrContext *convert_ctx = NULL; |
36 |
#elif defined(HAVE_AVRESAMPLE) |
37 |
AVAudioResampleContext *convert_ctx = NULL; |
38 |
+#else |
39 |
+ void *convert_ctx = NULL; |
40 |
#endif |
41 |
int max_dst_nb_samples = 0, dst_linsize = 0; |
42 |
uint8_t *dst_data[1] = { NULL }; |
43 |
@@ -75,6 +77,7 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name |
44 |
goto done; |
45 |
} |
46 |
|
47 |
+#if defined(HAVE_SWRESAMPLE) || defined(HAVE_AVRESAMPLE) |
48 |
if (codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16) { |
49 |
int64_t channel_layout = codec_ctx->channel_layout; |
50 |
if (!channel_layout) { |
51 |
@@ -111,6 +114,7 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name |
52 |
} |
53 |
#endif |
54 |
} |
55 |
+#endif |
56 |
|
57 |
if (stream->duration != AV_NOPTS_VALUE) { |
58 |
*duration = stream->time_base.num * stream->duration / stream->time_base.den; |
59 |
@@ -155,10 +159,11 @@ int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name |
60 |
max_dst_nb_samples = frame->nb_samples; |
61 |
} |
62 |
#if defined(HAVE_SWRESAMPLE) |
63 |
- if (swr_convert(convert_ctx, dst_data, frame->nb_samples, (const uint8_t **)frame->data, frame->nb_samples) < 0) { |
64 |
+ if (swr_convert(convert_ctx, dst_data, frame->nb_samples, (const uint8_t **)frame->data, frame->nb_samples) < 0) |
65 |
#elif defined(HAVE_AVRESAMPLE) |
66 |
- if (avresample_convert(convert_ctx, dst_data, 0, frame->nb_samples, (uint8_t **)frame->data, 0, frame->nb_samples) < 0) { |
67 |
+ if (avresample_convert(convert_ctx, dst_data, 0, frame->nb_samples, (uint8_t **)frame->data, 0, frame->nb_samples) < 0) |
68 |
#endif |
69 |
+ { |
70 |
fprintf(stderr, "ERROR: couldn't convert the audio\n"); |
71 |
goto done; |
72 |
} |
73 |
-- |
74 |
1.9.rc2.211.gd198f5d |