Jacob Meuser wrote:
probably.  maybe this patch (picked from ffmpeg svn some time ago)
helps?  ffmpeg really needs to be updated ...

The patch fixes the segfault but the regression tests which uses ffmpeg still fails.
Ok to add this patch to ffmpeg port ?
 Cheers
  Giovanni
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/Makefile,v
retrieving revision 1.46
diff -u -p -r1.46 Makefile
--- Makefile    14 Apr 2009 19:52:08 -0000      1.46
+++ Makefile    9 Jun 2009 10:45:11 -0000
@@ -4,7 +4,7 @@ COMMENT=        audio/video converter and strea
 
 V=                     20080620
 DISTNAME=              ffmpeg-svn-${V}
-PKGNAME=               ffmpeg-${V}p8
+PKGNAME=               ffmpeg-${V}p9
 SHARED_LIBS=           avutil          6.0 \
                        avcodec         13.0 \
                        avformat        12.0 \
Index: patches/patch-libavcodec_i386_dsputil_mmx_c
===================================================================
RCS file: patches/patch-libavcodec_i386_dsputil_mmx_c
diff -N patches/patch-libavcodec_i386_dsputil_mmx_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-libavcodec_i386_dsputil_mmx_c 9 Jun 2009 10:45:11 -0000
@@ -0,0 +1,68 @@
+$OpenBSD$
+--- libavcodec/i386/dsputil_mmx.c.orig Sun May 25 07:00:38 2008
++++ libavcodec/i386/dsputil_mmx.c      Tue Jun  9 12:11:32 2009
+@@ -482,6 +482,7 @@ static void clear_blocks_mmx(DCTELEM *blocks)
+ static void add_bytes_mmx(uint8_t *dst, uint8_t *src, int w){
+     x86_reg i=0;
+     asm volatile(
++        "jmp 2f                         \n\t"
+         "1:                             \n\t"
+         "movq  (%1, %0), %%mm0          \n\t"
+         "movq  (%2, %0), %%mm1          \n\t"
+@@ -492,8 +493,9 @@ static void add_bytes_mmx(uint8_t *dst, uint8_t *src, 
+         "paddb %%mm0, %%mm1             \n\t"
+         "movq %%mm1, 8(%2, %0)          \n\t"
+         "add $16, %0                    \n\t"
++        "2:                             \n\t"
+         "cmp %3, %0                     \n\t"
+-        " jb 1b                         \n\t"
++        " js 1b                         \n\t"
+         : "+r" (i)
+         : "r"(src), "r"(dst), "r"((x86_reg)w-15)
+     );
+@@ -504,6 +506,7 @@ static void add_bytes_mmx(uint8_t *dst, uint8_t *src, 
+ static void add_bytes_l2_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int 
w){
+     x86_reg i=0;
+     asm volatile(
++        "jmp 2f                         \n\t"
+         "1:                             \n\t"
+         "movq   (%2, %0), %%mm0         \n\t"
+         "movq  8(%2, %0), %%mm1         \n\t"
+@@ -512,8 +515,9 @@ static void add_bytes_l2_mmx(uint8_t *dst, uint8_t *sr
+         "movq %%mm0,  (%1, %0)          \n\t"
+         "movq %%mm1, 8(%1, %0)          \n\t"
+         "add $16, %0                    \n\t"
++        "2:                             \n\t"
+         "cmp %4, %0                     \n\t"
+-        " jb 1b                         \n\t"
++        " js 1b                         \n\t"
+         : "+r" (i)
+         : "r"(dst), "r"(src1), "r"(src2), "r"((x86_reg)w-15)
+     );
+@@ -784,7 +788,7 @@ static void draw_edges_mmx(uint8_t *buf, int wrap, int
+ }
+ 
+ #define PAETH(cpu, abs3)\
+-void add_png_paeth_prediction_##cpu(uint8_t *dst, uint8_t *src, uint8_t *top, 
int w, int bpp)\
++static void add_png_paeth_prediction_##cpu(uint8_t *dst, uint8_t *src, 
uint8_t *top, int w, int bpp)\
+ {\
+     x86_reg i = -bpp;\
+     x86_reg end = w-3;\
+@@ -2018,7 +2022,7 @@ static void vector_fmul_add_add_sse(float *dst, const 
+         ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step);
+ }
+ 
+-static void float_to_int16_3dnow(int16_t *dst, const float *src, int len){
++static void float_to_int16_3dnow(int16_t *dst, const float *src, long len){
+     // not bit-exact: pf2id uses different rounding than C and SSE
+     int i;
+     for(i=0; i<len; i+=4) {
+@@ -2033,7 +2037,7 @@ static void float_to_int16_3dnow(int16_t *dst, const f
+     }
+     asm volatile("femms");
+ }
+-static void float_to_int16_sse(int16_t *dst, const float *src, int len){
++static void float_to_int16_sse(int16_t *dst, const float *src, long len){
+     int i;
+     for(i=0; i<len; i+=4) {
+         asm volatile(

Reply via email to