Package: chromaprint
Version: 0.6-2
Severity: important

Dear Maintainer,

Your package chromaprint current fails to build against libav9, which is
currently in experimental. Please review and discuss the attached patch
with your upstream.

Thanks,
Reinhard

-- System Information:
Debian Release: wheezy/sid
  APT prefers raring-proposed
  APT policy: (500, 'raring-proposed'), (500, 'raring')
Architecture: amd64 (x86_64)

Kernel: Linux 3.5.0-18-generic (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Description: Fixes FTBFS against libav9
  This patch updates the API usage against libav
Author: Reinhard Tartler <[email protected]>

---

Origin: Ubuntu
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: no

--- chromaprint-0.6.orig/examples/fpcalc.c
+++ chromaprint-0.6/examples/fpcalc.c
@@ -28,12 +28,12 @@ int decode_audio_file(ChromaprintContext
 #endif
 	int16_t *buffer;
 
-	if (av_open_input_file(&format_ctx, file_name, NULL, 0, NULL) != 0) {
+	if (avformat_open_input(&format_ctx, file_name, NULL, NULL) != 0) {
 		fprintf(stderr, "ERROR: couldn't open the file\n");
 		goto done;
 	}
 
-	if (av_find_stream_info(format_ctx) < 0) {
+	if (avformat_find_stream_info(format_ctx, NULL) < 0) {
 		fprintf(stderr, "ERROR: couldn't find stream information in the file\n");
 		goto done;
 	}
@@ -60,7 +60,7 @@ int decode_audio_file(ChromaprintContext
 		goto done;
 	}
 
-	if (avcodec_open(codec_ctx, codec) < 0) {
+	if (avcodec_open2(codec_ctx, codec, NULL) < 0) {
 		fprintf(stderr, "ERROR: couldn't open the codec\n");
 		goto done;
 	}
@@ -71,9 +71,9 @@ int decode_audio_file(ChromaprintContext
 		goto done;
 	}
 
-	if (codec_ctx->sample_fmt != SAMPLE_FMT_S16) {
+	if (codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
 #ifdef HAVE_AV_AUDIO_CONVERT
-		convert_ctx = av_audio_convert_alloc(SAMPLE_FMT_S16, codec_ctx->channels,
+		convert_ctx = av_audio_convert_alloc(AV_SAMPLE_FMT_S16, codec_ctx->channels,
 		                                     codec_ctx->sample_fmt, codec_ctx->channels, NULL, 0);
 		if (!convert_ctx) {
 			fprintf(stderr, "ERROR: couldn't create sample format converter\n");
@@ -133,7 +133,7 @@ int decode_audio_file(ChromaprintContext
 			if (convert_ctx) {
 				const void *ibuf[6] = { buffer1 };
 				void *obuf[6] = { buffer2 };
-				int istride[6] = { av_get_bits_per_sample_format(codec_ctx->sample_fmt) / 8 };
+				int istride[6] = { av_get_bytes_per_sample(codec_ctx->sample_fmt) };
 				int ostride[6] = { 2 };
 				int len = buffer_size / istride[0];
 				if (av_audio_convert(convert_ctx, obuf, ostride, ibuf, istride, len) < 0) {
--- chromaprint-0.6.orig/src/fft_lib_avfft.h
+++ chromaprint-0.6/src/fft_lib_avfft.h
@@ -25,6 +25,7 @@
 extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavcodec/avfft.h>
+#include <libavutil/mem.h>
 }
 #include "combined_buffer.h"
 

Reply via email to