media-video/dvdstyler: fix build with ffmpeg git master.
authorAlexis Ballier <aballier@gentoo.org>
Wed, 16 Sep 2015 10:31:13 +0000 (12:31 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Wed, 16 Sep 2015 10:31:13 +0000 (12:31 +0200)
Package-Manager: portage-2.2.20.1

media-video/dvdstyler/dvdstyler-2.9.3.ebuild
media-video/dvdstyler/files/ffmpeg29.patch [new file with mode: 0644]

index c5bc193a50f947582fb1adf9b6e3f23bf3b6d613..914cefef65d98efe718468b6f95e9008bcce857b 100644 (file)
@@ -7,7 +7,7 @@ EAPI=5
 MY_P=${P/dvds/DVDS}
 WX_GTK_VER=2.8
 
-inherit wxwidgets
+inherit wxwidgets eutils
 
 DESCRIPTION="A cross-platform free DVD authoring application"
 HOMEPAGE="http://www.dvdstyler.org/"
@@ -51,6 +51,7 @@ src_prepare() {
        sed -i \
                -e '/Icon/s:.png::' -e '/^Encoding/d' -e '/Categories/s:Application;::' \
                data/dvdstyler.desktop || die
+       has_version '>=media-video/ffmpeg-2.9' && epatch "${FILESDIR}/ffmpeg29.patch"
 }
 
 src_configure() {
diff --git a/media-video/dvdstyler/files/ffmpeg29.patch b/media-video/dvdstyler/files/ffmpeg29.patch
new file mode 100644 (file)
index 0000000..22ab9a6
--- /dev/null
@@ -0,0 +1,31 @@
+Index: DVDStyler-2.9.3/src/mediaenc_ffmpeg.cpp
+===================================================================
+--- DVDStyler-2.9.3.orig/src/mediaenc_ffmpeg.cpp
++++ DVDStyler-2.9.3/src/mediaenc_ffmpeg.cpp
+@@ -178,7 +178,7 @@ bool wxFfmpegMediaEncoder::addVideoStrea
+       c->time_base.den = isNTSC(videoFormat) ? 30000 : 25;
+       c->time_base.num = isNTSC(videoFormat) ? 1001 : 1;
+       c->gop_size = isNTSC(videoFormat) ? 15 : 12;
+-      c->pix_fmt = PIX_FMT_YUV420P;
++      c->pix_fmt = AV_PIX_FMT_YUV420P;
+       c->rc_buffer_size = VIDEO_BUF_SIZE;
+       c->rc_max_rate = 9000000;
+       c->rc_min_rate = 0;
+@@ -279,7 +279,7 @@ void wxFfmpegMediaEncoder::CloseAudioEnc
+       m_audioStm = NULL;
+ }
+-AVFrame* allocPicture(PixelFormat pix_fmt, int width, int height) {
++AVFrame* allocPicture(AVPixelFormat pix_fmt, int width, int height) {
+       AVFrame* frame = av_frame_alloc();
+       if (!frame)
+               return NULL;
+@@ -318,7 +318,7 @@ bool wxFfmpegMediaEncoder::OpenVideoEnco
+               return false;
+       }
+-      m_imgConvertCtx = sws_getContext(c->width, c->height, PIX_FMT_RGB24, c->width, c->height, c->pix_fmt, SWS_BICUBIC,
++      m_imgConvertCtx = sws_getContext(c->width, c->height, AV_PIX_FMT_RGB24, c->width, c->height, c->pix_fmt, SWS_BICUBIC,
+                       NULL, NULL, NULL);
+       if (!m_imgConvertCtx) {
+               wxLogError(wxT("Cannot initialize the conversion context"));