On 2017/09/07 07:02, Jan Beich wrote:
> Stuart Henderson <stu@spacehopper.org> writes:
>
> [...]
> > So this works around the recently-reported hangs seen on amd64 but we
> > still have a segfault issue on i386 (I've only seen this so far when
> > decoding H264, though given the function other things may use it too).
>
> Probably same as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205958
> Update to FFmpeg 3.2+ or try the following patch.
Great - with that patch I can decode H264 without crashing.
I do then hit the problem with AAC encoding on i386 (which I *didn't*
hit before this change), whether it's built with base or ports clang,
but that's a less urgent problem.
So while it's not perfect I think this is preferable to the current
situation.
Brad: OK with this for now?
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/Makefile,v
retrieving revision 1.164
diff -u -p -r1.164 Makefile
--- Makefile 4 Sep 2017 19:27:56 -0000 1.164
+++ Makefile 7 Sep 2017 13:48:30 -0000
@@ -5,7 +5,7 @@ COMMENT= audio/video converter and strea
V= 20170825
DISTNAME= ffmpeg-git-${V}
PKGNAME= ffmpeg-${V}
-REVISION= 0
+REVISION= 1
CATEGORIES= graphics multimedia
MASTER_SITES= http://comstyle.com/source/
EXTRACT_SUFX= .tar.xz
@@ -33,9 +33,10 @@ WANTLIB= SDL X11 Xext Xv ass bz2 c crypt
vorbisenc vpx>=5 x264 x265>=2 xcb xcb-shape xcb-shm xcb-xfixes \
xvidcore z
-# AAC encoder hangs on amd64 when built with clang 4.0.0 or 4.0.1 but
-# succeeds with ports clang 5.0.0rc4.
-# XXX h264 decoder segfaults in ff_deblock_v_luma_8_sse2 on i386
+# AAC encoder hangs on at least amd64/i386 when built with base
+# clang and at least in some cases ports clang 4.0.0 or 4.0.1.
+# It succeeds with ports clang 5.0.0rc4 on amd64, though not i386.
+# e.g. "ffmpeg -i somefile.mkv -acodec aac out.mkv"
COMPILER= base-gcc ports-clang base-clang
COMPILER_LANGS= c
MODCLANG_ARCHS= amd64
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/patches/patch-configure,v
retrieving revision 1.55
diff -u -p -r1.55 patch-configure
--- patches/patch-configure 11 Dec 2016 09:27:53 -0000 1.55
+++ patches/patch-configure 7 Sep 2017 13:48:30 -0000
@@ -2,8 +2,12 @@ $OpenBSD: patch-configure,v 1.55 2016/12
lavu/random_seed: use arc4random() when available
---- configure.orig Sat Dec 10 20:37:25 2016
-+++ configure Sat Dec 10 20:43:59 2016
+-mstack-alignment=16, -mstack-realign: h264 decoder segfaults
+in ff_deblock_v_luma_8_sse2 on i386
+
+Index: configure
+--- configure.orig
++++ configure
@@ -1755,6 +1755,7 @@ MATH_FUNCS="
SYSTEM_FUNCS="
access
@@ -38,7 +42,18 @@ lavu/random_seed: use arc4random() when
check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
check_func fcntl
check_func fork
-@@ -5788,6 +5790,11 @@ if test $target_os = "haiku"; then
+@@ -5685,6 +5687,10 @@ elif enabled llvm_gcc; then
+ check_cflags -mllvm -stack-alignment=16
+ elif enabled clang; then
+ check_cflags -mllvm -stack-alignment=16
++ check_cflags -mstack-alignment=16
++ if enabled x86_32; then
++ check_cflags -mstackrealign
++ fi
+ check_cflags -Qunused-arguments
+ check_cflags -Werror=implicit-function-declaration
+ check_cflags -Werror=missing-prototypes
+@@ -5788,6 +5794,11 @@ if test $target_os = "haiku"; then
disable posix_memalign
fi
@@ -50,7 +65,7 @@ lavu/random_seed: use arc4random() when
enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
enable dxva2_lib
-@@ -6220,8 +6227,8 @@ pkgconfig_generate(){
+@@ -6220,8 +6231,8 @@ pkgconfig_generate(){
comment=$2
version=$3
libs=$4
@@ -61,7 +76,7 @@ lavu/random_seed: use arc4random() when
enabled ${name#lib} || return 0
mkdir -p $name
cat <<EOF > $name/$name${build_suffix}.pc
-@@ -6236,7 +6243,7 @@ Version: $version
+@@ -6236,7 +6247,7 @@ Version: $version
Requires: $(enabled shared || echo $requires)
Requires.private: $(enabled shared && echo $requires)
Conflicts:
@@ -70,7 +85,7 @@ lavu/random_seed: use arc4random() when
Libs.private: $(enabled shared && echo $libs)
Cflags: -I\${includedir}
EOF
-@@ -6260,12 +6267,12 @@ Cflags: -I\${includedir}
+@@ -6260,12 +6271,12 @@ Cflags: -I\${includedir}
EOF
}
No comments:
Post a Comment