summaryrefslogtreecommitdiff
path: root/community-testing/chromaprint/ffmpeg.patch
blob: 7c0b86d770257d194ce0eca20f9fe2c06147442d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff -Naur old/examples/fpcalc.c new/examples/fpcalc.c
--- old/examples/fpcalc.c	2011-12-22 22:11:23.000000000 +1100
+++ new/examples/fpcalc.c	2012-06-04 10:44:30.596604910 +1000
@@ -28,7 +28,7 @@
 #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;
 	}
@@ -71,9 +71,9 @@
 		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 @@
 			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) {