summaryrefslogtreecommitdiffstats
path: root/audio/lastfm/LAV_Source_fix.patch
diff options
context:
space:
mode:
author Willy Sudiarto Raharjo <willysr@slackbuilds.org>2017-02-13 16:46:39 +0100
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2017-04-15 07:18:16 +0700
commit26cf71ba2d7909f648fd0e0efba3706a8099ce8b (patch)
treeb0f1a310887c109d4ba87b69c70b19f0543164b2 /audio/lastfm/LAV_Source_fix.patch
parented4f3ed13425cbdeb6c9dc36d20fc073a91821ec (diff)
downloadslackbuilds-26cf71ba2d7909f648fd0e0efba3706a8099ce8b.tar.gz
slackbuilds-26cf71ba2d7909f648fd0e0efba3706a8099ce8b.tar.xz
audio/lastfm: Fixed for the newer ffmpeg.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'audio/lastfm/LAV_Source_fix.patch')
-rw-r--r--audio/lastfm/LAV_Source_fix.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/audio/lastfm/LAV_Source_fix.patch b/audio/lastfm/LAV_Source_fix.patch
new file mode 100644
index 0000000000..a5721cb167
--- /dev/null
+++ b/audio/lastfm/LAV_Source_fix.patch
@@ -0,0 +1,40 @@
+--- app/fingerprinter/LAV_Source.cpp
++++ app/fingerprinter/LAV_Source.cpp
+@@ -23,6 +23,10 @@
+ #define __STDC_CONSTANT_MACROS 1
+ #endif
+
++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
++#endif
++
+ extern "C" {
+ #include <libavformat/avformat.h>
+ #include <libavutil/mathematics.h>
+@@ -113,7 +117,7 @@
+ {
+ char buf[256];
+ AVPacket packet;
+- AVFrame *decodedFrame = avcodec_alloc_frame();
++ AVFrame *decodedFrame = av_frame_alloc();
+ av_init_packet(&packet);
+
+ int frameFinished = 0;
+@@ -288,7 +292,7 @@
+ av_free_packet(&packet);
+ }
+ timestamp += (double)nSamples / decodedFrame->sample_rate;
+- avcodec_free_frame(&decodedFrame);
++ av_frame_free(&decodedFrame);
+ return outBuffer;
+ }
+
+@@ -405,7 +409,7 @@
+
+ void LAV_Source::release()
+ {
+- if ( d->inCodecContext && d->inCodecContext->codec_id != CODEC_ID_NONE )
++ if ( d->inCodecContext && d->inCodecContext->codec_id != AV_CODEC_ID_NONE )
+ {
+ avcodec_close(d->inCodecContext);
+ }