Skip to content

Commit

Permalink
Make sure the package compiles with both Libav 10 (in Debian testing …
Browse files Browse the repository at this point in the history
…and unstable) and Libav 9 (in some downstream distros like Ubuntu), the patch for Libav 10 compatibility (in commit 7bf48cd) broke the compilation with older Libav versions.
  • Loading branch information
martin-steghoefer committed Aug 29, 2014
1 parent ef92d32 commit ce95e10
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -2,7 +2,7 @@ Source: karlyriceditor
Section: utils
Priority: extra
Maintainer: Martin Steghöfer <martin@steghoefer.eu>
Build-Depends: debhelper (>= 8), autotools-dev, dpkg-dev (>= 1.16), qt4-qmake, libavformat-dev (>= 6:10), libavresample-dev (>= 6:10), pkg-config, libswscale-dev, libsdl1.2-dev, libqt4-dev-bin, libqt4-dev, docbook-to-man
Build-Depends: debhelper (>= 8), autotools-dev, dpkg-dev (>= 1.16), qt4-qmake, libavformat-dev (>= 6:9), libavresample-dev (>= 6:9), pkg-config, libswscale-dev, libsdl1.2-dev, libqt4-dev-bin, libqt4-dev, docbook-to-man
Standards-Version: 3.9.5
Homepage: http://sourceforge.net/projects/karlyriceditor/
Vcs-Git: https://github.com/martin-steghoefer/debian-karlyriceditor.git
Expand Down
29 changes: 28 additions & 1 deletion debian/patches/0007-Fix-compilation-FFmpeg-Libav.patch
Expand Up @@ -23,9 +23,10 @@ FFmpeg's. This patch adapts the code to several of those differences:
av_free).
---
src/audioplayerprivate.cpp | 4 ++--
src/ffmpeg_headers.h | 10 ++++++++++
src/ffmpegvideodecoder.cpp | 8 ++++----
src/ffmpegvideoencoder.cpp | 32 ++++++++++++++++++++------------
3 files changed, 26 insertions(+), 18 deletions(-)
4 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/src/audioplayerprivate.cpp b/src/audioplayerprivate.cpp
index 1b6b32d..a6536cd 100644
Expand All @@ -49,6 +50,32 @@ index 1b6b32d..a6536cd 100644

if ( !m_frame )
{
diff --git a/src/ffmpeg_headers.h b/src/ffmpeg_headers.h
index 3d18808..c108c86 100644
--- a/src/ffmpeg_headers.h
+++ b/src/ffmpeg_headers.h
@@ -34,6 +34,7 @@ extern "C"
#include <libswscale/swscale.h>
#include <libavresample/avresample.h>
#include <libavutil/opt.h>
+#include <libavutil/version.h>

};

@@ -41,4 +42,13 @@ void ffmpeg_init_once();

#define FFMPEG_FILENAME(string) ( qPrintable(string) )

+/*
+ * Functions were renamed in interface version 53 (=10.0), but are
+ * essentially the same (documentation literally says the same).
+ */
+#if LIBAVUTIL_VERSION_MAJOR < 53
+# define av_frame_alloc avcodec_alloc_frame
+# define av_frame_free avcodec_free_frame
+#endif
+
#endif // FFMPEG_HEADERS_H
diff --git a/src/ffmpegvideodecoder.cpp b/src/ffmpegvideodecoder.cpp
index 2ec5969..7820f72 100644
--- a/src/ffmpegvideodecoder.cpp
Expand Down

0 comments on commit ce95e10

Please sign in to comment.