[Ffmpeg-devel] [PATCH] better gdb report on crash in fft.c on mingw.

Hervé W. H.O.W.aka.V+ffmpeg
Sat Jul 1 12:09:09 CEST 2006


Hi,

Perhaps an explanation why this problem occured is in order.
Commn's cpu has 3dnow (MM_3DNOW) which sets has_vectors in
ff_fft_init, but because his system doesn't have SSE or the mm3dnow
header, s->fft_calc is still set to ff_fft_calc_c, but ffmpeg still
thought it has_vectors and called av_freep(&s->exptab), which should
only happen when not using ff_fft_calc_c.

The change:
ff_fft_init now double checks that the system has mm3dnow.h before
checking if the cpu can do 3dnow at all.

-V
-------------- next part --------------
Index: libavcodec/fft.c
===================================================================
--- libavcodec/fft.c	(revision 5538)
+++ libavcodec/fft.c	(working copy)
@@ -62,7 +62,11 @@
         int has_vectors = 0;
 
 #if defined(HAVE_MMX)
+# ifdef HAVE_MM3DNOW
         has_vectors = mm_support() & (MM_3DNOW | MM_3DNOWEXT | MM_SSE | MM_SSE2);
+# else
+        has_vectors = mm_support() & (MM_SSE | MM_SSE2);
+# endif
 #endif
 #if defined(HAVE_ALTIVEC) && !defined(ALTIVEC_USE_REFERENCE_C_CODE)
         has_vectors = mm_support() & MM_ALTIVEC;



More information about the ffmpeg-devel mailing list