From 26cf71ba2d7909f648fd0e0efba3706a8099ce8b Mon Sep 17 00:00:00 2001 From: Willy Sudiarto Raharjo Date: Mon, 13 Feb 2017 16:46:39 +0100 Subject: audio/lastfm: Fixed for the newer ffmpeg. Signed-off-by: Matteo Bernardini --- audio/lastfm/LAV_Source_fix.patch | 40 +++++++++++++++++++++++++++++++++++++++ audio/lastfm/ffmpeg-2.0.patch | 13 ------------- audio/lastfm/lastfm.SlackBuild | 4 ++-- 3 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 audio/lastfm/LAV_Source_fix.patch delete mode 100644 audio/lastfm/ffmpeg-2.0.patch 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 + #include +@@ -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); + } diff --git a/audio/lastfm/ffmpeg-2.0.patch b/audio/lastfm/ffmpeg-2.0.patch deleted file mode 100644 index a8e7c93fb0..0000000000 --- a/audio/lastfm/ffmpeg-2.0.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Naur lastfm-desktop-2.1.36.orig/app/fingerprinter/LAV_Source.cpp lastfm-desktop-2.1.36/app/fingerprinter/LAV_Source.cpp ---- lastfm-desktop-2.1.36.orig/app/fingerprinter/LAV_Source.cpp 2013-09-03 12:19:10.000000000 +0000 -+++ lastfm-desktop-2.1.36/app/fingerprinter/LAV_Source.cpp 2014-01-01 02:15:23.422896266 +0000 -@@ -34,6 +34,9 @@ - # include - # include - #endif -+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE -+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio -+#endif - } - - #include diff --git a/audio/lastfm/lastfm.SlackBuild b/audio/lastfm/lastfm.SlackBuild index 142b932ef6..ac88062b9c 100644 --- a/audio/lastfm/lastfm.SlackBuild +++ b/audio/lastfm/lastfm.SlackBuild @@ -72,13 +72,13 @@ find -L . \ # Fix paths. cat $CWD/package-paths.patch | sed -e "s|@LIBDIRSUFFIX@|$LIBDIRSUFFIX|" \ | patch -p1 -# Fix for ffmpeg 2.x. -patch -p1 < $CWD/ffmpeg-2.0.patch # Fix for "ambiguous overload for ‘operator<<’" in gcc-4.9 # thanks to Spiek on github (https://github.com/lastfm/lastfm-desktop/pull/44) patch -p1 < $CWD/github-192b979c57a.patch # Turn on verbose compile output. sed -i 's|^CONFIG.*|#&|' admin/include.qmake +# Fix for ffmpeg 3.x +patch -p0 < $CWD/LAV_Source_fix.patch qmake PREFIX="/usr" QMAKE_CFLAGS+="$SLKCFLAGS" QMAKE_CXXFLAGS+="$SLKCFLAGS" \ CONFIG+="release" LIBS+="-L/usr/lib${LIBDIRSUFFIX}" -o Makefile Last.fm.pro -- cgit v1.2.3