]> git.pld-linux.org Git - packages/chromaprint.git/commitdiff
- fix build with ffmpeg 2
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 29 Aug 2013 07:53:27 +0000 (09:53 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Thu, 29 Aug 2013 07:53:27 +0000 (09:53 +0200)
chromaprint-ffmpeg2.0.patch [new file with mode: 0644]
chromaprint.spec

diff --git a/chromaprint-ffmpeg2.0.patch b/chromaprint-ffmpeg2.0.patch
new file mode 100644 (file)
index 0000000..6640258
--- /dev/null
@@ -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;
index 7d8cb22e758c58e41c768c0a13fff5d4ddb648f3..afc5d0f99c4e5aa4c7a92e89cf128091e645f1e4 100644 (file)
@@ -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 . \
This page took 0.112276 seconds and 4 git commands to generate.