summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /media-video/cinelerra
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'media-video/cinelerra')
-rw-r--r--media-video/cinelerra/Manifest2
-rw-r--r--media-video/cinelerra/cinelerra-20120707.ebuild103
-rw-r--r--media-video/cinelerra/cinelerra-20140710.ebuild108
-rw-r--r--media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch134
-rw-r--r--media-video/cinelerra/files/cinelerra-20140710-underlinking.patch16
-rw-r--r--media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch14
-rw-r--r--media-video/cinelerra/files/cinelerra-entry.patch14
-rw-r--r--media-video/cinelerra/files/cinelerra-ffmpeg-0.11.patch156
-rw-r--r--media-video/cinelerra/files/cinelerra-ffmpeg.patch76
-rw-r--r--media-video/cinelerra/files/cinelerra-ffmpeg2.patch218
-rw-r--r--media-video/cinelerra/files/cinelerra-libav9.patch93
-rw-r--r--media-video/cinelerra/files/cinelerra-nofindobject.patch16
-rw-r--r--media-video/cinelerra/files/cinelerra-pngtoh.patch15
-rw-r--r--media-video/cinelerra/files/cinelerra-std_and_str_h.patch81
-rw-r--r--media-video/cinelerra/files/cinelerra-underlinking.patch15
-rw-r--r--media-video/cinelerra/metadata.xml5
16 files changed, 1066 insertions, 0 deletions
diff --git a/media-video/cinelerra/Manifest b/media-video/cinelerra/Manifest
new file mode 100644
index 000000000000..29c9ef5ad5e4
--- /dev/null
+++ b/media-video/cinelerra/Manifest
@@ -0,0 +1,2 @@
+DIST cinelerra-20120707.tar.xz 22542220 SHA256 b909531fd1f5a11b85463ea06a62f703f2be67cbe79cd90c035d569a3019f5ad SHA512 af5ed92c223c1e0658ea3320aeefb568b94299ec14947e422f845b72bb271e7592142ac3d119daa9ce2a1b15e708d5ae2214a051f6d4ba67bd3ec733fc607171 WHIRLPOOL add200da410aafb3ad8bd6113061ba055a57978b4f9b717275b0c22375968e7aaa6c5c5a1d0f1ce2c4da3a630b9218fe2e5ae795b30bdfbfb532a3d793fd6065
+DIST cinelerra-20140710.tar.xz 24843336 SHA256 3a7c72e68c7fa8d20f0186bd9460453973e2ffdccc9e0fff1fd9114610361ff2 SHA512 ede8e3888c24022802b45909b8977ec449262f17bd488bf1fab9885b3cb76fa0a66f82e780e204bde2cd3e1da2952aec927d733f21b9883601f128478eeb81db WHIRLPOOL cf56e7f3531ff4f6e2d350bb5fc247f71106f60f016dc20fc7e73556cd05dd97c812b61709109210f76e30c67552e03f9927a52e92f6ce6d83227438cdc4314b
diff --git a/media-video/cinelerra/cinelerra-20120707.ebuild b/media-video/cinelerra/cinelerra-20120707.ebuild
new file mode 100644
index 000000000000..eaee626918c6
--- /dev/null
+++ b/media-video/cinelerra/cinelerra-20120707.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils multilib flag-o-matic
+
+DESCRIPTION="The most advanced non-linear video editor and compositor"
+HOMEPAGE="http://www.cinelerra.org/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="cpu_flags_x86_3dnow alsa altivec css ieee1394 cpu_flags_x86_mmx opengl oss"
+
+RDEPEND="media-libs/a52dec:=
+ media-libs/faac:=
+ media-libs/faad2:=
+ >=media-libs/freetype-2
+ media-libs/libdv:=
+ >=media-libs/libogg-1.2:=
+ media-libs/libpng:0=
+ media-libs/libsndfile:=
+ >=media-libs/libtheora-1.1:=
+ >=media-libs/libvorbis-1.3:=
+ >=media-libs/openexr-1.5:=
+ media-libs/tiff:0=
+ media-libs/x264:=
+ media-sound/lame:=
+ >=media-video/mjpegtools-2
+ >=sci-libs/fftw-3
+ x11-libs/libX11:=
+ x11-libs/libXext:=
+ x11-libs/libXft:=
+ x11-libs/libXv:=
+ x11-libs/libXvMC:=
+ x11-libs/libXxf86vm:=
+ virtual/ffmpeg
+ || ( media-video/ffmpeg:0 media-libs/libpostproc )
+ virtual/jpeg:0
+ alsa? ( media-libs/alsa-lib:= )
+ ieee1394? (
+ media-libs/libiec61883:=
+ >=sys-libs/libraw1394-1.2.0:=
+ >=sys-libs/libavc1394-0.5.0:=
+ )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig
+ cpu_flags_x86_mmx? ( dev-lang/nasm )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-entry.patch \
+ "${FILESDIR}"/${PN}-ffmpeg.patch \
+ "${FILESDIR}"/${PN}-underlinking.patch \
+ "${FILESDIR}"/${PN}-ffmpeg-0.11.patch \
+ "${FILESDIR}"/${PN}-std_and_str_h.patch \
+ "${FILESDIR}"/${PN}-libav9.patch
+
+ if has_version '>=media-video/ffmpeg-2' ; then
+ epatch "${FILESDIR}"/${PN}-ffmpeg2.patch
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ append-cppflags -D__STDC_CONSTANT_MACROS #321945
+ append-ldflags -Wl,-z,noexecstack #212959
+
+ econf \
+ $(use_enable oss) \
+ $(use_enable alsa) \
+ --disable-esd \
+ $(use_enable ieee1394 firewire) \
+ $(use_enable css) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable cpu_flags_x86_3dnow 3dnow) \
+ $(use_enable altivec) \
+ $(use_enable opengl) \
+ --with-plugindir=/usr/$(get_libdir)/${PN} \
+ --with-buildinfo=cust/"Gentoo - ${PV}" \
+ --with-external-ffmpeg
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dohtml -a png,html,texi,sdw -r doc/*
+
+ rm -rf "${D}"/usr/include
+ mv -vf "${D}"/usr/bin/mpeg3cat{,.hv} || die
+ mv -vf "${D}"/usr/bin/mpeg3dump{,.hv} || die
+ mv -vf "${D}"/usr/bin/mpeg3toc{,.hv} || die
+ dosym /usr/bin/mpeg2enc /usr/$(get_libdir)/${PN}/mpeg2enc.plugin
+
+ prune_libtool_files --all
+}
diff --git a/media-video/cinelerra/cinelerra-20140710.ebuild b/media-video/cinelerra/cinelerra-20140710.ebuild
new file mode 100644
index 000000000000..6574dea8929a
--- /dev/null
+++ b/media-video/cinelerra/cinelerra-20140710.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils multilib flag-o-matic
+
+DESCRIPTION="The most advanced non-linear video editor and compositor"
+HOMEPAGE="http://www.cinelerra.org/"
+SRC_URI="http://dev.gentoo.org/~ssuominen/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="cpu_flags_x86_3dnow alsa altivec css debug ieee1394 cpu_flags_x86_mmx opengl oss"
+
+RDEPEND="media-libs/a52dec:=
+ media-libs/faac:=
+ media-libs/faad2:=
+ >=media-libs/freetype-2
+ media-libs/libdv:=
+ >=media-libs/libogg-1.2:=
+ media-libs/libpng:0=
+ media-libs/libsndfile:=
+ >=media-libs/libtheora-1.1:=
+ >=media-libs/libvorbis-1.3:=
+ >=media-libs/openexr-1.5:=
+ media-libs/tiff:0=
+ media-libs/x264:=
+ media-sound/lame:=
+ >=media-video/mjpegtools-2
+ >=sci-libs/fftw-3
+ x11-libs/libX11:=
+ x11-libs/libXext:=
+ x11-libs/libXft:=
+ x11-libs/libXv:=
+ x11-libs/libXvMC:=
+ x11-libs/libXxf86vm:=
+ virtual/ffmpeg
+ || ( media-video/ffmpeg:0 media-libs/libpostproc )
+ virtual/jpeg:0
+ alsa? ( media-libs/alsa-lib:= )
+ ieee1394? (
+ media-libs/libiec61883:=
+ >=sys-libs/libraw1394-1.2.0:=
+ >=sys-libs/libavc1394-0.5.0:=
+ )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig
+ cpu_flags_x86_mmx? ( dev-lang/nasm )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-validate_desktop_entry.patch \
+ "${FILESDIR}"/${PN}-ffmpeg.patch \
+ "${FILESDIR}"/${P}-underlinking.patch \
+ "${FILESDIR}"/${P}-ffmpeg-0.11.patch \
+ "${FILESDIR}"/${PN}-libav9.patch \
+ "${FILESDIR}"/${PN}-pngtoh.patch \
+ "${FILESDIR}"/${PN}-nofindobject.patch
+
+ if has_version '>=media-video/ffmpeg-2' ; then
+ epatch "${FILESDIR}"/${PN}-ffmpeg2.patch
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ append-cppflags -D__STDC_CONSTANT_MACROS #321945
+ append-ldflags -Wl,-z,noexecstack #212959
+
+ local myconf
+ use debug && myconf='--enable-x-error-output'
+
+ econf \
+ $(use_enable oss) \
+ $(use_enable alsa) \
+ --disable-esd \
+ $(use_enable ieee1394 firewire) \
+ $(use_enable css) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable cpu_flags_x86_3dnow 3dnow) \
+ $(use_enable altivec) \
+ $(use_enable opengl) \
+ --with-plugindir=/usr/$(get_libdir)/${PN} \
+ --with-buildinfo=cust/"Gentoo - ${PV}" \
+ --with-external-ffmpeg \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dohtml -a png,html,texi,sdw -r doc/*
+
+ rm -rf "${D}"/usr/include
+ mv -vf "${D}"/usr/bin/mpeg3cat{,.hv} || die
+ mv -vf "${D}"/usr/bin/mpeg3dump{,.hv} || die
+ mv -vf "${D}"/usr/bin/mpeg3toc{,.hv} || die
+ dosym /usr/bin/mpeg2enc /usr/$(get_libdir)/${PN}/mpeg2enc.plugin
+
+ prune_libtool_files --all
+}
diff --git a/media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch b/media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch
new file mode 100644
index 000000000000..2aebd7008c3c
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch
@@ -0,0 +1,134 @@
+--- cinelerra/ffmpeg.C
++++ cinelerra/ffmpeg.C
+@@ -23,7 +23,6 @@
+
+ int FFMPEG::init(char *codec_string) {
+
+- avcodec_init();
+ avcodec_register_all();
+
+ CodecID id = codec_id(codec_string);
+--- cinelerra/fileac3.C
++++ cinelerra/fileac3.C
+@@ -84,7 +84,6 @@
+
+ if(wr)
+ {
+- avcodec_init();
+ avcodec_register_all();
+ codec = avcodec_find_encoder(CODEC_ID_AC3);
+ if(!codec)
+--- configure.ac
++++ configure.ac
+@@ -497,7 +497,7 @@
+ AC_ARG_WITH([external-ffmpeg], AC_HELP_STRING([--with-external-ffmpeg], [use external ffmpeg library]))
+
+ if test "x$with_external_ffmpeg" = "xyes"; then
+- PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc])
++ PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc libavutil])
+ FFMPEG_FOLDER=""
+ FFMPEG_EXTERNALTEXT="External ffmpeg"
+
+@@ -515,10 +515,10 @@
+ AC_MSG_RESULT($enable_ffmpeg_swscale)
+ if test x"$enable_ffmpeg_swscale" = xyes; then
+ dnl AC_DEFINE(HAVE_SWSCALER)
+- PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale])
++ PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale libavutil])
+ FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/libavcodec -I/usr/include/libswscale -DHAVE_SWSCALER"
+ else
+- PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc])
++ PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libavutil])
+ fi
+ FFMPEG_EXTERNALTEXT="External ffmpeg"
+ else
+--- quicktime/mpeg4.c
++++ quicktime/mpeg4.c
+@@ -624,12 +624,12 @@
+ else
+ // ffmpeg section
+ {
++ AVDictionary ** opts = NULL;
+ static char *video_rc_eq="tex^qComp";
+ codec->encode_initialized[current_field] = 1;
+ if(!ffmpeg_initialized)
+ {
+ ffmpeg_initialized = 1;
+- avcodec_init();
+ avcodec_register_all();
+ }
+
+@@ -673,8 +673,10 @@
+ context->b_quant_offset = 1.25;
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ context->error_resilience = FF_ER_CAREFUL;
+-#else
++#elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0)
+ context->error_recognition = FF_ER_CAREFUL;
++#else
++ context->err_recognition |= AV_EF_CAREFUL;
+ #endif
+ context->error_concealment = 3;
+ context->frame_skip_cmp = FF_CMP_DCTMAX;
+@@ -699,7 +701,7 @@
+ context->profile= FF_PROFILE_UNKNOWN;
+ context->rc_buffer_aggressivity = 1.0;
+ context->level= FF_LEVEL_UNKNOWN;
+- context->flags |= CODEC_FLAG_H263P_UMV;
++ av_dict_set(opts, "umv", "1", 0);
+ context->flags |= CODEC_FLAG_AC_PRED;
+
+ // All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg...
+@@ -717,10 +719,8 @@
+ (codec->ffmpeg_id == CODEC_ID_MPEG4 ||
+ codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
+ codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
+- codec->ffmpeg_id == CODEC_ID_H263P ||
+- codec->ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
++ codec->ffmpeg_id == CODEC_ID_H263P ))
+ {
+- avcodec_thread_init(context, file->cpus);
+ context->thread_count = file->cpus;
+ }
+
+@@ -740,7 +740,7 @@
+ * codec->fix_bitrate,
+ * codec->quantizer);
+ */
+- avcodec_open(context, codec->encoder[current_field]);
++ avcodec_open2(context, codec->encoder[current_field], opts);
+
+ avcodec_get_frame_defaults(&codec->picture[current_field]);
+
+--- quicktime/qtffmpeg.c
++++ quicktime/qtffmpeg.c
+@@ -54,7 +54,6 @@
+ if(!ffmpeg_initialized)
+ {
+ ffmpeg_initialized = 1;
+- avcodec_init();
+ avcodec_register_all();
+ }
+
+@@ -90,10 +89,8 @@
+ (ffmpeg_id == CODEC_ID_MPEG4 ||
+ ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
+ ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
+- ffmpeg_id == CODEC_ID_H263P ||
+- ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
++ ffmpeg_id == CODEC_ID_H263P ))
+ {
+- avcodec_thread_init(context, cpus);
+ context->thread_count = cpus;
+ }
+ if(avcodec_open(context,
+--- quicktime/wma.c
++++ quicktime/wma.c
+@@ -67,7 +67,6 @@
+ if(!ffmpeg_initialized)
+ {
+ ffmpeg_initialized = 1;
+- avcodec_init();
+ avcodec_register_all();
+ }
+
diff --git a/media-video/cinelerra/files/cinelerra-20140710-underlinking.patch b/media-video/cinelerra/files/cinelerra-20140710-underlinking.patch
new file mode 100644
index 000000000000..a7dc74f2d445
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-20140710-underlinking.patch
@@ -0,0 +1,16 @@
+http://bugs.gentoo.org/367509
+
+pluginserver.C is using dlsym, dlopen, dlclose and dlerror
+
+--- cinelerra/Makefile.am
++++ cinelerra/Makefile.am
+@@ -692,7 +692,8 @@
+ $(LIBDV_LIBS) \
+ -luuid \
+ $(MJPEG_LIBS) \
+- -lstdc++
++ -lstdc++ \
++ -ldl
+
+ EXTRA_DIST = gen-feather-h
+
diff --git a/media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch b/media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch
new file mode 100644
index 000000000000..006217586630
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch
@@ -0,0 +1,14 @@
+--- image/cinelerra-cv.desktop
++++ image/cinelerra-cv.desktop
+@@ -5,9 +5,8 @@
+ Name[fr]=Cinelerra-CV
+ Name[es]=Cinelerra-CV
+ Comment=Video Editor
+-Categories=Application;AudioVideo;Multimedia;VideoEditing;
+-Encoding=UTF-8
++Categories=AudioVideo;
+ Exec=cinelerra
+-Icon=cinelerra-cv.xpm
++Icon=cinelerra-cv
+ Terminal=false
+ Type=Application
diff --git a/media-video/cinelerra/files/cinelerra-entry.patch b/media-video/cinelerra/files/cinelerra-entry.patch
new file mode 100644
index 000000000000..22987d895a6d
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-entry.patch
@@ -0,0 +1,14 @@
+--- image/cinelerra.desktop
++++ image/cinelerra.desktop
+@@ -5,9 +5,8 @@
+ Name[fr]=Cinelerra
+ Name[es]=Cinelerra
+ Comment=Video Editor
+-Categories=Application;AudioVideo;Multimedia;
+-Encoding=UTF-8
++Categories=AudioVideo;
+ Exec=cinelerra
+-Icon=cinelerra.xpm
++Icon=cinelerra
+ Terminal=false
+ Type=Application
diff --git a/media-video/cinelerra/files/cinelerra-ffmpeg-0.11.patch b/media-video/cinelerra/files/cinelerra-ffmpeg-0.11.patch
new file mode 100644
index 000000000000..6d59cc8408ed
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-ffmpeg-0.11.patch
@@ -0,0 +1,156 @@
+Let it build with ffmpeg-0.11
+
+Index: cinelerra-20111223/cinelerra/ffmpeg.C
+===================================================================
+--- cinelerra-20111223.orig/cinelerra/ffmpeg.C
++++ cinelerra-20111223/cinelerra/ffmpeg.C
+@@ -23,7 +23,6 @@ FFMPEG::FFMPEG(Asset *asset) {
+
+ int FFMPEG::init(char *codec_string) {
+
+- avcodec_init();
+ avcodec_register_all();
+
+ CodecID id = codec_id(codec_string);
+Index: cinelerra-20111223/cinelerra/fileac3.C
+===================================================================
+--- cinelerra-20111223.orig/cinelerra/fileac3.C
++++ cinelerra-20111223/cinelerra/fileac3.C
+@@ -84,7 +84,6 @@ int FileAC3::open_file(int rd, int wr)
+
+ if(wr)
+ {
+- avcodec_init();
+ avcodec_register_all();
+ codec = avcodec_find_encoder(CODEC_ID_AC3);
+ if(!codec)
+Index: cinelerra-20111223/configure.in
+===================================================================
+--- cinelerra-20111223.orig/configure.in
++++ cinelerra-20111223/configure.in
+@@ -338,7 +338,7 @@ AC_SUBST(CPU_CFLAGS)
+ AC_ARG_WITH([external-ffmpeg], AC_HELP_STRING([--with-external-ffmpeg], [use external ffmpeg library]))
+
+ if test "x$with_external_ffmpeg" = "xyes"; then
+- PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc])
++ PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc libavutil])
+ FFMPEG_FOLDER=""
+ FFMPEG_EXTERNALTEXT="External ffmpeg"
+
+@@ -356,10 +356,10 @@ if test "x$with_external_ffmpeg" = "xyes
+ AC_MSG_RESULT($enable_ffmpeg_swscale)
+ if test x"$enable_ffmpeg_swscale" = xyes; then
+ dnl AC_DEFINE(HAVE_SWSCALER)
+- PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale])
++ PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale libavutil])
+ FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/libavcodec -I/usr/include/libswscale -DHAVE_SWSCALER"
+ else
+- PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc])
++ PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libavutil])
+ fi
+ FFMPEG_EXTERNALTEXT="External ffmpeg"
+ else
+Index: cinelerra-20111223/quicktime/mpeg4.c
+===================================================================
+--- cinelerra-20111223.orig/quicktime/mpeg4.c
++++ cinelerra-20111223/quicktime/mpeg4.c
+@@ -8,6 +8,7 @@
+
+
+ #include "libavcodec/avcodec.h"
++#include "libavutil/dict.h"
+ #include "colormodels.h"
+ #include "funcprotos.h"
+ #include "qtffmpeg.h"
+@@ -624,12 +625,12 @@ static int encode(quicktime_t *file, uns
+ else
+ // ffmpeg section
+ {
++ AVDictionary ** opts = NULL;
+ static char *video_rc_eq="tex^qComp";
+ codec->encode_initialized[current_field] = 1;
+ if(!ffmpeg_initialized)
+ {
+ ffmpeg_initialized = 1;
+- avcodec_init();
+ avcodec_register_all();
+ }
+
+@@ -673,8 +674,10 @@ static int encode(quicktime_t *file, uns
+ context->b_quant_offset = 1.25;
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ context->error_resilience = FF_ER_CAREFUL;
+-#else
++#elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0)
+ context->error_recognition = FF_ER_CAREFUL;
++#else
++ context->err_recognition |= AV_EF_CAREFUL;
+ #endif
+ context->error_concealment = 3;
+ context->frame_skip_cmp = FF_CMP_DCTMAX;
+@@ -699,7 +702,7 @@ static int encode(quicktime_t *file, uns
+ context->profile= FF_PROFILE_UNKNOWN;
+ context->rc_buffer_aggressivity = 1.0;
+ context->level= FF_LEVEL_UNKNOWN;
+- context->flags |= CODEC_FLAG_H263P_UMV;
++ av_dict_set(opts, "umv", "1", 0);
+ context->flags |= CODEC_FLAG_AC_PRED;
+
+ // All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg...
+@@ -717,10 +720,8 @@ static int encode(quicktime_t *file, uns
+ (codec->ffmpeg_id == CODEC_ID_MPEG4 ||
+ codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
+ codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
+- codec->ffmpeg_id == CODEC_ID_H263P ||
+- codec->ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
++ codec->ffmpeg_id == CODEC_ID_H263P ))
+ {
+- avcodec_thread_init(context, file->cpus);
+ context->thread_count = file->cpus;
+ }
+
+@@ -740,7 +741,7 @@ static int encode(quicktime_t *file, uns
+ * codec->fix_bitrate,
+ * codec->quantizer);
+ */
+- avcodec_open(context, codec->encoder[current_field]);
++ avcodec_open2(context, codec->encoder[current_field], opts);
+
+ avcodec_get_frame_defaults(&codec->picture[current_field]);
+
+Index: cinelerra-20111223/quicktime/qtffmpeg.c
+===================================================================
+--- cinelerra-20111223.orig/quicktime/qtffmpeg.c
++++ cinelerra-20111223/quicktime/qtffmpeg.c
+@@ -54,7 +54,6 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg
+ if(!ffmpeg_initialized)
+ {
+ ffmpeg_initialized = 1;
+- avcodec_init();
+ avcodec_register_all();
+ }
+
+@@ -90,10 +89,8 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg
+ (ffmpeg_id == CODEC_ID_MPEG4 ||
+ ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
+ ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
+- ffmpeg_id == CODEC_ID_H263P ||
+- ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
++ ffmpeg_id == CODEC_ID_H263P ))
+ {
+- avcodec_thread_init(context, cpus);
+ context->thread_count = cpus;
+ }
+ if(avcodec_open(context,
+Index: cinelerra-20111223/quicktime/wma.c
+===================================================================
+--- cinelerra-20111223.orig/quicktime/wma.c
++++ cinelerra-20111223/quicktime/wma.c
+@@ -67,7 +67,6 @@ static int init_decode(quicktime_audio_m
+ if(!ffmpeg_initialized)
+ {
+ ffmpeg_initialized = 1;
+- avcodec_init();
+ avcodec_register_all();
+ }
+
diff --git a/media-video/cinelerra/files/cinelerra-ffmpeg.patch b/media-video/cinelerra/files/cinelerra-ffmpeg.patch
new file mode 100644
index 000000000000..6f7962fb1a54
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-ffmpeg.patch
@@ -0,0 +1,76 @@
+Fix build with ffmpeg/libav trunk / 0.7
+
+Index: cinelerra-20101104/cinelerra/ffmpeg.C
+===================================================================
+--- cinelerra-20101104.orig/cinelerra/ffmpeg.C
++++ cinelerra-20101104/cinelerra/ffmpeg.C
+@@ -364,12 +364,15 @@ int FFMPEG::decode(uint8_t *data, long d
+
+ // NOTE: frame must already have data space allocated
+
++ AVPacket pkt;
+ got_picture = 0;
+- int length = avcodec_decode_video(context,
++ av_init_packet( &pkt );
++ pkt.data = data;
++ pkt.size = data_size;
++ int length = avcodec_decode_video2(context,
+ picture,
+ &got_picture,
+- data,
+- data_size);
++ &pkt);
+
+ if (length < 0) {
+ printf("FFMPEG::decode error decoding frame\n");
+Index: cinelerra-20101104/quicktime/qtffmpeg.c
+===================================================================
+--- cinelerra-20101104.orig/quicktime/qtffmpeg.c
++++ cinelerra-20101104/quicktime/qtffmpeg.c
+@@ -181,6 +181,7 @@ static int decode_wrapper(quicktime_t *f
+
+ if(!result)
+ {
++ AVPacket pkt;
+
+
+ // No way to determine if there was an error based on nonzero status.
+@@ -189,11 +190,13 @@ static int decode_wrapper(quicktime_t *f
+ ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_NONREF /* AVDISCARD_BIDIR */;
+ else
+ ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_DEFAULT;
+- result = avcodec_decode_video(ffmpeg->decoder_context[current_field],
++ av_init_packet( &pkt );
++ pkt.data = ffmpeg->work_buffer;
++ pkt.size = bytes + header_bytes;
++ result = avcodec_decode_video2(ffmpeg->decoder_context[current_field],
+ &ffmpeg->picture[current_field],
+ &got_picture,
+- ffmpeg->work_buffer,
+- bytes + header_bytes);
++ &pkt);
+
+
+
+Index: cinelerra-20101104/quicktime/wma.c
+===================================================================
+--- cinelerra-20101104.orig/quicktime/wma.c
++++ cinelerra-20101104/quicktime/wma.c
+@@ -195,11 +195,14 @@ printf("decode 2 %x %llx %llx\n", chunk_
+ chunk_size);
+ #else
+ bytes_decoded = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+- result = avcodec_decode_audio2(codec->decoder_context,
++ AVPacket pkt;
++ av_init_packet( &pkt );
++ pkt.data = codec->packet_buffer;
++ pkt.size = chunk_size;
++ result = avcodec_decode_audio3(codec->decoder_context,
+ (int16_t*)(codec->work_buffer + codec->output_size * sample_size),
+ &bytes_decoded,
+- codec->packet_buffer,
+- chunk_size);
++ &pkt);
+ #endif
+
+ pthread_mutex_unlock(&ffmpeg_lock);
diff --git a/media-video/cinelerra/files/cinelerra-ffmpeg2.patch b/media-video/cinelerra/files/cinelerra-ffmpeg2.patch
new file mode 100644
index 000000000000..01680ac952f1
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-ffmpeg2.patch
@@ -0,0 +1,218 @@
+https://bugs.gentoo.org/show_bug.cgi?id=479394
+By Helmut Jarausch
+
+--- cinelerra/ffmpeg.h.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ cinelerra/ffmpeg.h 2013-08-01 12:58:12.342474136 +0200
+@@ -26,7 +26,7 @@
+ static int convert_cmodel_transfer(VFrame *frame_in,VFrame *frame_out);
+ static int init_picture_from_frame(AVPicture *picture, VFrame *frame);
+
+- static CodecID codec_id(char *codec_string);
++ static AVCodecID codec_id(char *codec_string);
+
+ private:
+ static PixelFormat color_model_to_pix_fmt(int color_model);
+--- cinelerra/ffmpeg.C.ORIG 2013-08-01 11:24:43.794419246 +0200
++++ cinelerra/ffmpeg.C 2013-08-01 12:57:48.121473899 +0200
+@@ -25,7 +25,7 @@
+
+ avcodec_register_all();
+
+- CodecID id = codec_id(codec_string);
++ AVCodecID id = codec_id(codec_string);
+ codec = avcodec_find_decoder(id);
+ if (codec == NULL) {
+ printf("FFMPEG::init no decoder for '%s'", codec_string);
+@@ -51,7 +51,7 @@
+ }
+
+
+-CodecID FFMPEG::codec_id(char *codec_string) {
++AVCodecID FFMPEG::codec_id(char *codec_string) {
+ #define CODEC_IS(x) (! strncmp(codec_string, x, 4))
+
+ if (CODEC_IS(QUICKTIME_DV) ||
+--- quicktime/ffmpeg/ffmpeg.c.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/ffmpeg.c 2013-08-01 12:57:59.025474005 +0200
+@@ -2663,7 +2663,7 @@
+ return 0;
+ }
+
+-static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
++static enum AVCodecID find_codec_or_die(const char *name, int type, int encoder)
+ {
+ const char *codec_string = encoder ? "encoder" : "decoder";
+ AVCodec *codec;
+--- quicktime/ffmpeg/libavformat/electronicarts.c.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/electronicarts.c 2013-08-01 13:00:57.855475755 +0200
+@@ -49,11 +49,11 @@
+ typedef struct EaDemuxContext {
+ int big_endian;
+
+- enum CodecID video_codec;
++ enum AVCodecID video_codec;
+ AVRational time_base;
+ int video_stream_index;
+
+- enum CodecID audio_codec;
++ enum AVCodecID audio_codec;
+ int audio_stream_index;
+ int audio_frame_counter;
+
+--- quicktime/ffmpeg/libavformat/img2.c.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/img2.c 2013-08-01 12:59:21.408474812 +0200
+@@ -34,7 +34,7 @@
+ } VideoData;
+
+ typedef struct {
+- enum CodecID id;
++ enum AVCodecID id;
+ const char *str;
+ } IdStrMap;
+
+@@ -97,7 +97,7 @@
+ }
+ return -1;
+ }
+-static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
++static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str)
+ {
+ str= strrchr(str, '.');
+ if(!str) return CODEC_ID_NONE;
+@@ -175,7 +175,7 @@
+ return 0;
+ }
+
+-enum CodecID av_guess_image2_codec(const char *filename){
++enum AVCodecID av_guess_image2_codec(const char *filename){
+ return av_str2id(img_tags, filename);
+ }
+
+--- quicktime/ffmpeg/libavformat/matroskadec.c.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/matroskadec.c 2013-08-01 12:59:57.556475165 +0200
+@@ -2476,7 +2476,7 @@
+ AVStream *st;
+
+ for (i = 0; i < matroska->num_tracks; i++) {
+- enum CodecID codec_id = CODEC_ID_NONE;
++ enum AVCodecID codec_id = CODEC_ID_NONE;
+ uint8_t *extradata = NULL;
+ int extradata_size = 0;
+ int extradata_offset = 0;
+@@ -2495,7 +2495,7 @@
+ }
+ }
+
+- /* Set the FourCC from the CodecID. */
++ /* Set the FourCC from the AVCodecID. */
+ /* This is the MS compatibility mode which stores a
+ * BITMAPINFOHEADER in the CodecPrivate. */
+ if (!strcmp(track->codec_id,
+@@ -2600,7 +2600,7 @@
+
+ if (codec_id == CODEC_ID_NONE) {
+ av_log(matroska->ctx, AV_LOG_INFO,
+- "Unknown/unsupported CodecID %s.\n",
++ "Unknown/unsupported AVCodecID %s.\n",
+ track->codec_id);
+ }
+
+--- quicktime/ffmpeg/libavformat/matroska.h.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/matroska.h 2013-08-01 13:00:22.218475407 +0200
+@@ -220,12 +220,12 @@
+
+ typedef struct CodecTags{
+ char str[16];
+- enum CodecID id;
++ enum AVCodecID id;
+ }CodecTags;
+
+ typedef struct CodecMime{
+ char str[32];
+- enum CodecID id;
++ enum AVCodecID id;
+ }CodecMime;
+
+ #define MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC "V_MS/VFW/FOURCC"
+--- quicktime/ffmpeg/libavformat/mov.c.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/mov.c 2013-08-01 12:59:33.935474934 +0200
+@@ -678,7 +678,7 @@
+
+ for(pseudo_stream_id=0; pseudo_stream_id<entries; pseudo_stream_id++) {
+ //Parsing Sample description table
+- enum CodecID id;
++ enum AVCodecID id;
+ int dref_id;
+ MOV_atom_t a = { 0, 0, 0 };
+ offset_t start_pos = url_ftell(pb);
+--- quicktime/ffmpeg/libavformat/mxf.c.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/mxf.c 2013-08-01 12:59:12.025474720 +0200
+@@ -157,7 +157,7 @@
+ typedef struct {
+ UID uid;
+ unsigned matching_len;
+- enum CodecID id;
++ enum AVCodecID id;
+ } MXFCodecUL;
+
+ typedef struct {
+--- quicktime/ffmpeg/libavformat/riff.h.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/riff.h 2013-08-01 12:59:45.950475052 +0200
+@@ -48,7 +48,7 @@
+ extern const AVCodecTag codec_wav_tags[];
+
+ unsigned int codec_get_tag(const AVCodecTag *tags, int id);
+-enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag);
++enum AVCodecID codec_get_id(const AVCodecTag *tags, unsigned int tag);
+ void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale);
+
+ #endif /* FFMPEG_RIFF_H */
+--- quicktime/ffmpeg/libavformat/rtp.c.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/rtp.c 2013-08-01 12:59:01.778474619 +0200
+@@ -40,7 +40,7 @@
+ int pt;
+ const char enc_name[6];
+ enum CodecType codec_type;
+- enum CodecID codec_id;
++ enum AVCodecID codec_id;
+ int clock_rate;
+ int audio_channels;
+ } AVRtpPayloadTypes[]=
+@@ -120,7 +120,7 @@
+ return "";
+ }
+
+-enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type)
++enum AVCodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type)
+ {
+ int i;
+
+--- quicktime/ffmpeg/libavformat/rtp_internal.h.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/ffmpeg/libavformat/rtp_internal.h 2013-08-01 13:00:09.147475279 +0200
+@@ -61,7 +61,7 @@
+ // fields from AVRtpDynamicPayloadType_s
+ const char enc_name[50]; /* XXX: still why 50 ? ;-) */
+ enum CodecType codec_type;
+- enum CodecID codec_id;
++ enum AVCodecID codec_id;
+
+ // may be null
+ int (*parse_sdp_a_line) (AVStream * stream,
+@@ -123,7 +123,7 @@
+
+ void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
+ const char *ff_rtp_enc_name(int payload_type);
+-enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type);
++enum AVCodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type);
+
+ void av_register_rtp_dynamic_payload_handlers(void);
+
+--- quicktime/wma.h.ORIG 2012-07-06 22:40:26.000000000 +0200
++++ quicktime/wma.h 2013-08-01 13:11:46.431482103 +0200
+@@ -3,5 +3,6 @@
+
+ extern void quicktime_init_codec_wmav1(quicktime_audio_map_t *);
+ extern void quicktime_init_codec_wmav2(quicktime_audio_map_t *);
++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
+
+ #endif
diff --git a/media-video/cinelerra/files/cinelerra-libav9.patch b/media-video/cinelerra/files/cinelerra-libav9.patch
new file mode 100644
index 000000000000..47a4d6f231e1
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-libav9.patch
@@ -0,0 +1,93 @@
+diff -urN cinelerra-20120707/cinelerra/ffmpeg.C /tmp/cinelerra-20120707/cinelerra/ffmpeg.C
+--- cinelerra-20120707/cinelerra/ffmpeg.C 2013-06-22 18:07:43.632978553 +0200
++++ /tmp/cinelerra-20120707/cinelerra/ffmpeg.C 2013-06-22 18:07:21.668979334 +0200
+@@ -32,9 +32,9 @@
+ return 1;
+ }
+
+- context = avcodec_alloc_context();
++ context = avcodec_alloc_context3(NULL);
+
+- if (avcodec_open(context, codec)) {
++ if (avcodec_open2(context, codec, NULL)) {
+ printf("FFMPEG::init avcodec_open() failed\n");
+ }
+
+diff -urN cinelerra-20120707/cinelerra/fileac3.C /tmp/cinelerra-20120707/cinelerra/fileac3.C
+--- cinelerra-20120707/cinelerra/fileac3.C 2013-06-22 18:07:43.632978553 +0200
++++ /tmp/cinelerra-20120707/cinelerra/fileac3.C 2013-06-22 18:07:21.668979334 +0200
+@@ -91,11 +91,11 @@
+ eprintf("codec not found.\n");
+ return 1;
+ }
+- codec_context = avcodec_alloc_context();
++ codec_context = avcodec_alloc_context3(NULL);
+ codec_context->bit_rate = asset->ac3_bitrate * 1000;
+ codec_context->sample_rate = asset->sample_rate;
+ codec_context->channels = asset->channels;
+- if(avcodec_open(codec_context, codec))
++ if(avcodec_open2(codec_context, codec, NULL))
+ {
+ eprintf("failed to open codec.\n");
+ return 1;
+diff -urN cinelerra-20120707/quicktime/mpeg4.c /tmp/cinelerra-20120707/quicktime/mpeg4.c
+--- cinelerra-20120707/quicktime/mpeg4.c 2013-06-22 18:07:43.633978553 +0200
++++ /tmp/cinelerra-20120707/quicktime/mpeg4.c 2013-06-22 18:07:21.690979334 +0200
+@@ -642,7 +642,7 @@
+ return 1;
+ }
+
+- codec->encoder_context[current_field] = avcodec_alloc_context();
++ codec->encoder_context[current_field] = avcodec_alloc_context3(NULL);
+ AVCodecContext *context = codec->encoder_context[current_field];
+
+ context->width = width_i;
+@@ -676,8 +676,6 @@
+ context->error_resilience = FF_ER_CAREFUL;
+ #elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0)
+ context->error_recognition = FF_ER_CAREFUL;
+-#else
+- context->err_recognition |= AV_EF_CAREFUL;
+ #endif
+ context->error_concealment = 3;
+ context->frame_skip_cmp = FF_CMP_DCTMAX;
+diff -urN cinelerra-20120707/quicktime/qtffmpeg.c /tmp/cinelerra-20120707/quicktime/qtffmpeg.c
+--- cinelerra-20120707/quicktime/qtffmpeg.c 2013-06-22 18:07:43.633978553 +0200
++++ /tmp/cinelerra-20120707/quicktime/qtffmpeg.c 2013-06-22 18:07:21.690979334 +0200
+@@ -67,7 +67,7 @@
+ return 0;
+ }
+
+- AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context();
++ AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context3(NULL);
+ static char fake_data[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ context->width = ptr->width_i;
+ context->height = ptr->height_i;
+@@ -93,8 +93,8 @@
+ {
+ context->thread_count = cpus;
+ }
+- if(avcodec_open(context,
+- ptr->decoder[i]) < 0)
++ if(avcodec_open2(context,
++ ptr->decoder[i], NULL) < 0)
+ {
+ printf("quicktime_new_ffmpeg: avcodec_open failed.\n");
+ quicktime_delete_ffmpeg(ptr);
+diff -urN cinelerra-20120707/quicktime/wma.c /tmp/cinelerra-20120707/quicktime/wma.c
+--- cinelerra-20120707/quicktime/wma.c 2013-06-22 18:07:43.634978553 +0200
++++ /tmp/cinelerra-20120707/quicktime/wma.c 2013-06-22 18:07:21.690979334 +0200
+@@ -76,10 +76,10 @@
+ printf("init_decode: avcodec_find_decoder returned NULL.\n");
+ return 1;
+ }
+- codec->decoder_context = avcodec_alloc_context();
++ codec->decoder_context = avcodec_alloc_context3(NULL);
+ codec->decoder_context->sample_rate = trak->mdia.minf.stbl.stsd.table[0].sample_rate;
+ codec->decoder_context->channels = track_map->channels;
+- if(avcodec_open(codec->decoder_context, codec->decoder) < 0)
++ if(avcodec_open2(codec->decoder_context, codec->decoder, NULL) < 0)
+ {
+ printf("init_decode: avcodec_open failed.\n");
+ return 1;
+
diff --git a/media-video/cinelerra/files/cinelerra-nofindobject.patch b/media-video/cinelerra/files/cinelerra-nofindobject.patch
new file mode 100644
index 000000000000..99acf2b643c7
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-nofindobject.patch
@@ -0,0 +1,16 @@
+Depends on features removed in opencv3.
+https://bugs.gentoo.org/show_bug.cgi?id=554516
+
+Index: cinelerra-20140710/configure.ac
+===================================================================
+--- cinelerra-20140710.orig/configure.ac
++++ cinelerra-20140710/configure.ac
+@@ -317,7 +317,7 @@ fi
+ AC_DEFINE_UNQUOTED(HAVE_OPENCV_SURF, $HAVE_OPENCV_SURF,
+ [define if SURF support is compiled into opencv])
+ if test "x$opencv" = "xyes" && test "x$opencvh" = "xyes" ; then
+- enable_findobject=ok
++ enable_findobject=no
+ fi
+ AM_CONDITIONAL(ENABLE_FINDOBJECT,test "x$enable_findobject" = "xok")
+ ############## END OF MISC LIBRARIES
diff --git a/media-video/cinelerra/files/cinelerra-pngtoh.patch b/media-video/cinelerra/files/cinelerra-pngtoh.patch
new file mode 100644
index 000000000000..81a8432b8729
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-pngtoh.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/show_bug.cgi?id=526118
+http://bugs.cinelerra-cv.org/ticket/1005
+
+Author: Bernd Feige
+
+--- guicast/pngtoh.c 2015-01-29 13:41:01 +0000
++++ guicast/pngtoh.c 2015-01-29 13:41:07 +0000
+@@ -148,4 +148,6 @@
+ fprintf(out, "};\n\n#endif\n");
+ fclose(out);
+ }
++
++ return 0;
+ }
+
diff --git a/media-video/cinelerra/files/cinelerra-std_and_str_h.patch b/media-video/cinelerra/files/cinelerra-std_and_str_h.patch
new file mode 100644
index 000000000000..2f8801ee087e
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-std_and_str_h.patch
@@ -0,0 +1,81 @@
+Include required headers for free(), memcpy(), strcpy(), bcopy(), and more
+Thanks to Martin von Gagern for reporting and initial patch
+See, http://bugs.gentoo.org/show_bug.cgi?id=465478
+
+--- cinelerra/vdevicebuz.C
++++ cinelerra/vdevicebuz.C
+@@ -49,6 +49,8 @@
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+ #include <unistd.h>
++#include <string.h>
++#include <strings.h>
+
+ #define BASE_VIDIOCPRIVATE 192
+
+--- cinelerra/videodevice.C
++++ cinelerra/videodevice.C
+@@ -53,6 +53,7 @@
+
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <string.h>
+
+ KeepaliveThread::KeepaliveThread(VideoDevice *device)
+ : Thread()
+--- libmpeg3/audio/ac3.c
++++ libmpeg3/audio/ac3.c
+@@ -1,3 +1,4 @@
++#include <stdlib.h>
+ #include <stdint.h>
+ #include <stdio.h>
+
+--- libmpeg3/audio/layer3.c
++++ libmpeg3/audio/layer3.c
+@@ -4,6 +4,7 @@
+ #include "tables.h"
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+
+ struct gr_info_s
+--- mplexlo/mplex.c
++++ mplexlo/mplex.c
+@@ -1,6 +1,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+-
++#include <string.h>
+
+ #include "libmpeg3.h"
+ #include "mpeg3protos.h"
+--- quicktime/graphics.c
++++ quicktime/graphics.c
+@@ -1,5 +1,6 @@
+ #include "graphics.h"
+
++#include <stdlib.h>
+ #include <string.h>
+
+ /* Graphics acceleration routines */
+--- quicktime/libmjpeg.c
++++ quicktime/libmjpeg.c
+@@ -17,6 +17,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include "colormodels.h"
+ #include "libmjpeg.h"
+
+--- quicktime/qtpng.c
++++ quicktime/qtpng.c
+@@ -1,6 +1,7 @@
+ #include "colormodels.h"
+ #include "funcprotos.h"
+ #include <png.h>
++#include <string.h>
+ #include "quicktime.h"
+ #include "qtpng.h"
+
diff --git a/media-video/cinelerra/files/cinelerra-underlinking.patch b/media-video/cinelerra/files/cinelerra-underlinking.patch
new file mode 100644
index 000000000000..1411d57cccd8
--- /dev/null
+++ b/media-video/cinelerra/files/cinelerra-underlinking.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/367509
+
+pluginserver.C is using dlsym, dlopen, dlclose and dlerror
+
+--- cinelerra/Makefile.am
++++ cinelerra/Makefile.am
+@@ -685,6 +685,7 @@
+ $(FIREWIRE_LDFLAGS) \
+ $(LIBDV_LIBS) \
+ -luuid \
+- $(MJPEG_LIBS)
++ $(MJPEG_LIBS) \
++ -ldl
+
+ EXTRA_DIST = gen-feather-h
diff --git a/media-video/cinelerra/metadata.xml b/media-video/cinelerra/metadata.xml
new file mode 100644
index 000000000000..92e4dbc04f50
--- /dev/null
+++ b/media-video/cinelerra/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>video</herd>
+</pkgmetadata>