[packages/chromaprint] - fix build with ffmpeg 2
baggins
baggins at pld-linux.org
Thu Aug 29 09:53:37 CEST 2013
commit 0492623ab1a5a1385fa967dcb42f9ef6e45e577a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Thu Aug 29 09:53:27 2013 +0200
- fix build with ffmpeg 2
chromaprint-ffmpeg2.0.patch | 31 +++++++++++++++++++++++++++++++
chromaprint.spec | 2 ++
2 files changed, 33 insertions(+)
---
diff --git a/chromaprint.spec b/chromaprint.spec
index 7d8cb22..afc5d0f 100644
--- a/chromaprint.spec
+++ b/chromaprint.spec
@@ -8,6 +8,7 @@ Group: Libraries
Source0: https://github.com/downloads/lalinsky/chromaprint/%{name}-%{version}.tar.gz
# Source0-md5: 3005fc2c69b9ef4a5c6787ef9355a855
Patch0: %{name}-ffmpeg.patch
+Patch1: %{name}-ffmpeg2.0.patch
URL: http://www.acoustid.org/chromaprint/
BuildRequires: boost-devel
BuildRequires: cmake >= 2.6
@@ -74,6 +75,7 @@ tworzenia aplikacji wykorzystujących bibliotekę libchromaprint.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%build
%cmake . \
diff --git a/chromaprint-ffmpeg2.0.patch b/chromaprint-ffmpeg2.0.patch
new file mode 100644
index 0000000..6640258
--- /dev/null
+++ b/chromaprint-ffmpeg2.0.patch
@@ -0,0 +1,31 @@
+--- chromaprint-0.7/examples/fpcalc.c.0000 2012-09-06 02:05:36.000000000 +0800
++++ chromaprint-0.7/examples/fpcalc.c 2013-07-11 12:46:13.408154060 +0800
+@@ -13,7 +13,7 @@
+ #define MAX(a, b) ((a) > (b) ? (a) : (b))
+ #define MIN(a, b) ((a) < (b) ? (a) : (b))
+
+-#define BUFFER_SIZE (AVCODEC_MAX_AUDIO_FRAME_SIZE * 2)
++#define BUFFER_SIZE (192000 * 2)
+
+ #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 94, 1)
+ #define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
+@@ -65,7 +65,10 @@
+ goto done;
+ }
+
+- if (avcodec_open(codec_ctx, codec) < 0) {
++ /* request regular signed 16-bit packed format */
++ codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
++
++ if (avcodec_open2(codec_ctx, codec, NULL) < 0) {
+ fprintf(stderr, "ERROR: couldn't open the codec\n");
+ goto done;
+ }
+@@ -146,6 +149,7 @@
+ int ostride[6] = { 2 };
+ int len = buffer_size / istride[0];
+ if (av_audio_convert(convert_ctx, obuf, ostride, ibuf, istride, len) < 0) {
++ fprintf(stderr, "WARNING: unable to convert %d samples\n", buffer_size);
+ break;
+ }
+ buffer = buffer2;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/chromaprint.git/commitdiff/0492623ab1a5a1385fa967dcb42f9ef6e45e577a
More information about the pld-cvs-commit
mailing list