changeset 9383:016519c432ef libavcodec

Fix sigill on non-MMX2 CPUs.
author diego
date Fri, 10 Apr 2009 11:29:51 +0000
parents 621852d53087
children 828d15d322ed
files motion-test.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/motion-test.c	Fri Apr 10 11:07:52 2009 +0000
+++ b/motion-test.c	Fri Apr 10 11:29:51 2009 +0000
@@ -29,6 +29,7 @@
 #include <sys/time.h>
 #include <unistd.h>
 
+#include "config.h"
 #include "dsputil.h"
 #include "libavutil/lfg.h"
 
@@ -128,6 +129,7 @@
     int c;
     DSPContext cctx, mmxctx;
     int flags[2] = { FF_MM_MMX, FF_MM_MMX2 };
+    int flags_size = HAVE_MMX2 ? 2 : 1;
 
     for(;;) {
         c = getopt(argc, argv, "h");
@@ -145,7 +147,7 @@
     ctx = avcodec_alloc_context();
     ctx->dsp_mask = FF_MM_FORCE;
     dsputil_init(&cctx, ctx);
-    for (c = 0; c < 1; c++) {
+    for (c = 0; c < flags_size; c++) {
         int x;
         ctx->dsp_mask = FF_MM_FORCE | flags[c];
         dsputil_init(&mmxctx, ctx);