summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Huettel <dilfridge@gentoo.org>2019-07-05 17:10:38 +0200
committerAndreas K. Huettel <dilfridge@gentoo.org>2019-07-05 17:11:15 +0200
commit1fc52f0bb000f6710d41bca2cef07dec319bb46a (patch)
treef156b4ed5d45b0dbf4a9d6eebc27ff2635b8df81
parentdev-python/nuitka: bump version to 0.6.4 (diff)
downloadgentoo-1fc52f0bb000f6710d41bca2cef07dec319bb46a.tar.gz
gentoo-1fc52f0bb000f6710d41bca2cef07dec319bb46a.tar.bz2
gentoo-1fc52f0bb000f6710d41bca2cef07dec319bb46a.zip
media-video/libav: Fix build on stable, bug 681888
Closes: https://bugs.gentoo.org/681888 Package-Manager: Portage-2.3.67, Repoman-2.3.16 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--media-video/libav/files/libav-12.3-x264.patch85
-rw-r--r--media-video/libav/libav-12.3.ebuild1
2 files changed, 86 insertions, 0 deletions
diff --git a/media-video/libav/files/libav-12.3-x264.patch b/media-video/libav/files/libav-12.3-x264.patch
new file mode 100644
index 000000000000..25c089bfeac1
--- /dev/null
+++ b/media-video/libav/files/libav-12.3-x264.patch
@@ -0,0 +1,85 @@
+From c6558e8840fbb2386bf8742e4d68dd6e067d262e Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero@gentoo.org>
+Date: Tue, 26 Dec 2017 12:32:42 +0100
+Subject: [PATCH] x264: Support version 153
+
+It has native simultaneus 8 and 10 bit support.
+---
+ libavcodec/libx264.c | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
+index 0dec12edd..3dc53aaf3 100644
+--- a/libavcodec/libx264.c
++++ b/libavcodec/libx264.c
+@@ -243,7 +243,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
+
+ x264_picture_init( &x4->pic );
+ x4->pic.img.i_csp = x4->params.i_csp;
++#if X264_BUILD >= 153
++ if (x4->params.i_bitdepth > 8)
++#else
+ if (x264_bit_depth > 8)
++#endif
+ x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
+ x4->pic.img.i_plane = 3;
+
+@@ -395,6 +399,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
+ x4->params.p_log_private = avctx;
+ x4->params.i_log_level = X264_LOG_DEBUG;
+ x4->params.i_csp = convert_pix_fmt(avctx->pix_fmt);
++#if X264_BUILD >= 153
++ x4->params.i_bitdepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
++#endif
+
+ if (avctx->bit_rate) {
+ x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
+@@ -659,6 +666,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
+ return 0;
+ }
+
++#if X264_BUILD < 153
+ static const enum AVPixelFormat pix_fmts_8bit[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUVJ420P,
+@@ -685,15 +693,37 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
+ AV_PIX_FMT_NV20,
+ AV_PIX_FMT_NONE
+ };
++#else
++static const enum AVPixelFormat pix_fmts_all[] = {
++ AV_PIX_FMT_YUV420P,
++ AV_PIX_FMT_YUVJ420P,
++ AV_PIX_FMT_YUV422P,
++ AV_PIX_FMT_YUVJ422P,
++ AV_PIX_FMT_YUV444P,
++ AV_PIX_FMT_YUVJ444P,
++ AV_PIX_FMT_NV12,
++ AV_PIX_FMT_NV16,
++ AV_PIX_FMT_NV21,
++ AV_PIX_FMT_YUV420P10,
++ AV_PIX_FMT_YUV422P10,
++ AV_PIX_FMT_YUV444P10,
++ AV_PIX_FMT_NV20,
++ AV_PIX_FMT_NONE
++};
++#endif
+
+ static av_cold void X264_init_static(AVCodec *codec)
+ {
++#if X264_BUILD < 153
+ if (x264_bit_depth == 8)
+ codec->pix_fmts = pix_fmts_8bit;
+ else if (x264_bit_depth == 9)
+ codec->pix_fmts = pix_fmts_9bit;
+ else if (x264_bit_depth == 10)
+ codec->pix_fmts = pix_fmts_10bit;
++#else
++ codec->pix_fmts = pix_fmts_all;
++#endif
+ }
+
+ #define OFFSET(x) offsetof(X264Context, x)
+--
+2.21.0
+
diff --git a/media-video/libav/libav-12.3.ebuild b/media-video/libav/libav-12.3.ebuild
index 30617cd70e6e..2e4a307f5bd2 100644
--- a/media-video/libav/libav-12.3.ebuild
+++ b/media-video/libav/libav-12.3.ebuild
@@ -144,6 +144,7 @@ src_unpack() {
src_prepare() {
eapply_user
+ eapply "${FILESDIR}/${P}-x264.patch" # bug 681888
# if we have snapshot then we need to hardcode the version
if [[ ${PV%_p*} != ${PV} ]]; then