diff options
author | Heinz Wiesinger <pprkut@slackbuilds.org> | 2012-08-19 13:34:23 +0200 |
---|---|---|
committer | Heinz Wiesinger <pprkut@slackbuilds.org> | 2012-08-20 11:18:33 +0200 |
commit | 20c2270322297bd1180279de65d20d15d44e532a (patch) | |
tree | 553da41610ce65c0c32893f400e46f0557fb00fb /desktop | |
parent | 0df7171d9cfca4ffa8a26875915c0e7d1979959a (diff) |
desktop/ffmpegthumbnailer: Fixed build with new ffmpeg
Signed-off-by: Heinz Wiesinger <pprkut@slackbuilds.org>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/ffmpegthumbnailer/README | 2 | ||||
-rw-r--r-- | desktop/ffmpegthumbnailer/ffmpeg.patch | 58 | ||||
-rw-r--r-- | desktop/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild | 6 |
3 files changed, 63 insertions, 3 deletions
diff --git a/desktop/ffmpegthumbnailer/README b/desktop/ffmpegthumbnailer/README index b3431abc350e..127d8f1bd4a2 100644 --- a/desktop/ffmpegthumbnailer/README +++ b/desktop/ffmpegthumbnailer/README @@ -2,5 +2,3 @@ FFmpegthumbnailer is a lightweight video thumbnailer that can be used by file managers to create thumbnails for your video files. The thumbnailer uses ffmpeg to decode frames from the video files, so supported videoformats depend on the configuration flags of ffmpeg. - -This requires ffmpeg. diff --git a/desktop/ffmpegthumbnailer/ffmpeg.patch b/desktop/ffmpegthumbnailer/ffmpeg.patch new file mode 100644 index 000000000000..f3167d40f322 --- /dev/null +++ b/desktop/ffmpegthumbnailer/ffmpeg.patch @@ -0,0 +1,58 @@ +Index: libffmpegthumbnailer/moviedecoder.cpp +=================================================================== +--- libffmpegthumbnailer/moviedecoder.cpp (revision 240) ++++ libffmpegthumbnailer/moviedecoder.cpp (revision 241) +@@ -58,19 +58,26 @@ + void MovieDecoder::initialize(const string& filename) + { + av_register_all(); +- avcodec_init(); + avcodec_register_all(); + + string inputFile = filename == "-" ? "pipe:" : filename; + m_AllowSeek = (filename != "-") && (filename.find("rtsp://") != 0); +- ++ ++#if LIBAVCODEC_VERSION_MAJOR < 53 + if ((!m_FormatContextWasGiven) && av_open_input_file(&m_pFormatContext, inputFile.c_str(), NULL, 0, NULL) != 0) ++#else ++ if ((!m_FormatContextWasGiven) && avformat_open_input(&m_pFormatContext, inputFile.c_str(), NULL, NULL) != 0) ++#endif + { + destroy(); + throw logic_error(string("Could not open input file: ") + filename); + } + ++#if LIBAVCODEC_VERSION_MAJOR < 53 + if (av_find_stream_info(m_pFormatContext) < 0) ++#else ++ if (avformat_find_stream_info(m_pFormatContext, NULL) < 0) ++#endif + { + destroy(); + throw logic_error(string("Could not find stream information")); +@@ -90,8 +97,12 @@ + + if ((!m_FormatContextWasGiven) && m_pFormatContext) + { ++#if LIBAVCODEC_VERSION_MAJOR < 53 + av_close_input_file(m_pFormatContext); + m_pFormatContext = NULL; ++#else ++ avformat_close_input(&m_pFormatContext); ++#endif + } + + if (m_pPacket) +@@ -159,7 +170,11 @@ + + m_pVideoCodecContext->workaround_bugs = 1; + ++#if LIBAVCODEC_VERSION_MAJOR < 53 + if (avcodec_open(m_pVideoCodecContext, m_pVideoCodec) < 0) ++#else ++ if (avcodec_open2(m_pVideoCodecContext, m_pVideoCodec, NULL) < 0) ++#endif + { + throw logic_error("Could not open video codec"); + } diff --git a/desktop/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild b/desktop/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild index ba02e2dfb93d..45edb813552e 100644 --- a/desktop/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild +++ b/desktop/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild @@ -3,6 +3,7 @@ # Slackware build script for FFmpegthumbnailer # Copyright 2007-2009 Frank Caraballo <fecaraballo{at}gmail{dot}com> +# Copyright 2012 Heinz Wiesinger, Amsterdam, The Netherlands # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +25,7 @@ PRGNAM=ffmpegthumbnailer VERSION=${VERSION:-2.0.7} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -69,6 +70,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Fix building against newer ffmpeg versions +patch -p0 -i $CWD/ffmpeg.patch + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ |