From 7730f6299855ddfb21ca6d7946b1917b9bf62bd1 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Mon, 27 Jul 2020 04:18:17 +0000 Subject: [PATCH] community/blender to 2.83.3-3 --- community/blender/D8355-ffmpeg43.patch | 35 ++++++++++++++++++++++++++ community/blender/PKGBUILD | 24 +++++++++++------- 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 community/blender/D8355-ffmpeg43.patch diff --git a/community/blender/D8355-ffmpeg43.patch b/community/blender/D8355-ffmpeg43.patch new file mode 100644 index 000000000..455937cc9 --- /dev/null +++ b/community/blender/D8355-ffmpeg43.patch @@ -0,0 +1,35 @@ +diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c +--- a/source/blender/imbuf/intern/anim_movie.c ++++ b/source/blender/imbuf/intern/anim_movie.c +@@ -1205,7 +1205,29 @@ + } + + IMB_freeImBuf(anim->last_frame); +- anim->last_frame = IMB_allocImBuf(anim->x, anim->y, 32, IB_rect); ++ ++ /* Certain versions of FFmpeg have a bug in libswscale which ends up in crash ++ * when destination buffer is not properly aligned. For example, this happens ++ * in FFmpeg 4.3.1. It got fixed later on, but for compatibility reasons is ++ * still best to avoid crash. ++ * ++ * This is achieved by using own allocation call rather than relying on ++ * IMB_allocImBuf() to do so since the IMB_allocImBuf() is not guaranteed ++ * to perform aligned allocation. ++ * ++ * In theory this could give better performance, since SIMD operations on ++ * aligned data are usually faster. ++ * ++ * Note that even though sometimes vertical flip is required it does not ++ * affect on alignment of data passed to sws_scale because if the X dimension ++ * is not 32 byte aligned special intermediate buffer is allocated. ++ * ++ * The issue was reported to FFmpeg under ticket #8747 in the FFmpeg tracker ++ * and is fixed in the newer versions than 4.3.1. */ ++ anim->last_frame = IMB_allocImBuf(anim->x, anim->y, 32, 0); ++ anim->last_frame->rect = MEM_mallocN_aligned((size_t)4 * anim->x * anim->y, 32, "ffmpeg ibuf"); ++ anim->last_frame->mall |= IB_rect; ++ + anim->last_frame->rect_colorspace = colormanage_colorspace_get_named(anim->colorspace); + + ffmpeg_postprocess(anim); + diff --git a/community/blender/PKGBUILD b/community/blender/PKGBUILD index 589b697e8..dac285c99 100644 --- a/community/blender/PKGBUILD +++ b/community/blender/PKGBUILD @@ -27,7 +27,7 @@ _gittag=v2.83.3 pkgname=blender pkgver=2.83.3 [[ -n $_gitcommit ]] && pkgver=${pkgver}.git1.${_gitcommit:0:8} -pkgrel=2 +pkgrel=3 epoch=17 pkgdesc="A fully integrated 3D graphics creation suite" arch=('x86_64') @@ -46,6 +46,7 @@ source=("git://git.blender.org/blender-addons.git" "git://git.blender.org/blender-dev-tools.git" embree.patch D8063-cuda11.diff + D8355-ffmpeg43.patch https://developer.download.nvidia.com/redist/optix/v7.0/OptiX-7.0.0-include.zip) if [[ -n $_gittag ]]; then source+=("${pkgname}-${pkgver}::git://git.blender.org/blender.git#tag=${_gittag}") @@ -58,6 +59,7 @@ sha512sums=('SKIP' 'SKIP' '6de779ad8649a034ee65c45a36d7838ac0b8b32c3336b4d476186265c060f56276e3e0a2860ec4bff42bef7d5582ee82238013845f6a697672767a05a455aaca' '7b0dc31c8babaaeed35807d27cc54e6e9fb79a08c4c267244bea2b47149e05089fe495f239fff7d4fff9b1ebcafd588396e8d1db5529dc7ac49d78731575e128' + '70e3bd8762c573cac4ec1d6772cdaab3ce6a248c26c78cbfe729d29058b3bf764305ee02525529955f292ad682883433ca20a91096ccb10d0cfe0148a67ee15f' 'b2cff73def3757d4259f4b4d318a8ccfe166bf7c215cbb2124f1c81bd6e742f96207285b24eb4d99b527b7b97dc6d5e8fdf2f16d78d5d1e2684c26d681328491' 'SKIP') @@ -74,15 +76,19 @@ prepare() { patch -Np1 -i "$srcdir"/embree.patch patch -Np1 -i "$srcdir"/D8063-cuda11.diff + # Fix crash with ffmpeg 4.3 (https://bugs.archlinux.org/task/67402) + patch -Np1 -i "$srcdir"/D8355-ffmpeg43.patch + mkdir build } build() { - cd "$srcdir/$pkgname-$pkgver"/build + cd "$srcdir/$pkgname-$pkgver" - cmake \ + cmake . \ + -Bbuild \ -GNinja \ - -C../build_files/cmake/config/blender_release.cmake .. \ + -Cbuild_files/cmake/config/blender_release.cmake \ -DOPTIX_ROOT_DIR="$srcdir"/include \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ @@ -95,16 +101,16 @@ build() { -DPYTHON_LIBRARY=python3.8 \ -DPYTHON_INCLUDE_DIRS=/usr/include/python3.8 - ninja + ninja -C build } package() { - cd "$srcdir/$pkgname-$pkgver/build" + cd "$srcdir/$pkgname-$pkgver" - DESTDIR="${pkgdir}" ninja install - install -Dm755 ../release/bin/blender-softwaregl "${pkgdir}/usr/bin/blender-softwaregl" + DESTDIR="${pkgdir}" ninja -C build install + install -Dm755 release/bin/blender-softwaregl "${pkgdir}/usr/bin/blender-softwaregl" python -m compileall "${pkgdir}/usr/share/blender" python -O -m compileall "${pkgdir}/usr/share/blender" - install -Dm644 ../release/freedesktop/org.blender.Blender.appdata.xml "${pkgdir}/usr/share/metainfo/org.blender.Blender.appdata.xml" + install -Dm644 release/freedesktop/org.blender.Blender.appdata.xml "${pkgdir}/usr/share/metainfo/org.blender.Blender.appdata.xml" }