1 --- chromaprint-0.7/examples/fpcalc.c.0000 2012-09-06 02:05:36.000000000 +0800
2 +++ chromaprint-0.7/examples/fpcalc.c 2013-07-11 12:46:13.408154060 +0800
4 #define MAX(a, b) ((a) > (b) ? (a) : (b))
5 #define MIN(a, b) ((a) < (b) ? (a) : (b))
7 -#define BUFFER_SIZE (AVCODEC_MAX_AUDIO_FRAME_SIZE * 2)
8 +#define BUFFER_SIZE (192000 * 2)
10 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 94, 1)
11 #define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
16 - if (avcodec_open(codec_ctx, codec) < 0) {
17 + /* request regular signed 16-bit packed format */
18 + codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
20 + if (avcodec_open2(codec_ctx, codec, NULL) < 0) {
21 fprintf(stderr, "ERROR: couldn't open the codec\n");
25 int ostride[6] = { 2 };
26 int len = buffer_size / istride[0];
27 if (av_audio_convert(convert_ctx, obuf, ostride, ibuf, istride, len) < 0) {
28 + fprintf(stderr, "WARNING: unable to convert %d samples\n", buffer_size);
32 --- chromaprint-0.7/src/ext/ffmpeg_decoder.h~ 2013-08-29 17:59:01.185761084 +0200
33 +++ chromaprint-0.7/src/ext/ffmpeg_decoder.h 2013-08-29 18:01:51.129329962 +0200
36 #include "audio_consumer.h"
38 +#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
39 +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
45 --- chromaprint-0.7/src/ext/ffmpeg_decoder.h~ 2013-08-29 18:01:51.129329962 +0200
46 +++ chromaprint-0.7/src/ext/ffmpeg_decoder.h 2013-08-29 18:06:34.402639744 +0200
51 - if (avcodec_open(m_codec_ctx, codec) < 0) {
52 + if (avcodec_open2(m_codec_ctx, codec, NULL) < 0) {
53 m_error = "Couldn't open the codec.";