Update fpcalc in chromaprint to the newer FFmpeg API.

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/audio/chromaprint/Makefile,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 Makefile
--- Makefile    18 Dec 2018 20:32:32 -0000      1.10
+++ Makefile    9 Feb 2019 17:50:05 -0000
@@ -6,7 +6,7 @@ DISTNAME =              chromaprint-1.1
 CATEGORIES =           audio devel
 HOMEPAGE =             https://acoustid.org/chromaprint
 MASTER_SITES =         https://bitbucket.org/acoustid/chromaprint/downloads/
-REVISION =             2
+REVISION =             3
 
 SHARED_LIBS =          chromaprint               1.0 # 0.1
 
Index: patches/patch-examples_fpcalc_c
===================================================================
RCS file: patches/patch-examples_fpcalc_c
diff -N patches/patch-examples_fpcalc_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-examples_fpcalc_c     9 Feb 2019 17:49:28 -0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+
+Update for newer FFmpeg API.
+
+Index: examples/fpcalc.c
+--- examples/fpcalc.c.orig
++++ examples/fpcalc.c
+@@ -126,7 +126,7 @@ int decode_audio_file(ChromaprintContext *chromaprint_
+       remaining = max_length * codec_ctx->channels * codec_ctx->sample_rate;
+       chromaprint_start(chromaprint_ctx, codec_ctx->sample_rate, 
codec_ctx->channels);
+ 
+-      frame = avcodec_alloc_frame();
++      frame = av_frame_alloc();
+ 
+       while (1) {
+               if (av_read_frame(format_ctx, &packet) < 0) {
+@@ -134,7 +134,7 @@ int decode_audio_file(ChromaprintContext *chromaprint_
+               }
+ 
+               if (packet.stream_index == stream_index) {
+-                      avcodec_get_frame_defaults(frame);
++                      av_frame_unref(frame);
+ 
+                       got_frame = 0;
+                       consumed = avcodec_decode_audio4(codec_ctx, frame, 
&got_frame, &packet);
+@@ -190,7 +190,7 @@ finish:
+ 
+ done:
+       if (frame) {
+-              avcodec_free_frame(&frame);
++              av_frame_free(&frame);
+       }
+       if (dst_data[0]) {
+               av_freep(&dst_data[0]);

Reply via email to