[FFmpeg-devel] [PATCH] fix motion-test on non-MMX CPUs
Michael Niedermayer
michaelni
Thu Apr 9 17:00:02 CEST 2009
On Thu, Apr 09, 2009 at 09:22:45AM +0200, Diego Biurrun wrote:
> Here is a patch to fix a sigill on CPUs without MMX2, like my trusty old
> K6-III, when running motion-test.
>
> If somebody has a prettier idea, I'm all ears.
>
> Diego
> Index: libavcodec/motion-test.c
> ===================================================================
> --- libavcodec/motion-test.c (revision 18382)
> +++ libavcodec/motion-test.c (working copy)
> @@ -29,6 +29,7 @@
> #include <sys/time.h>
> #include <unistd.h>
>
> +#include "config.h"
> #include "dsputil.h"
> #include "libavutil/lfg.h"
>
> @@ -127,7 +128,13 @@
> AVCodecContext *ctx;
> int c;
> DSPContext cctx, mmxctx;
> +#if HAVE_MMX2
> int flags[2] = { FF_MM_MMX, FF_MM_MMX2 };
> + int flags_size = 2;
> +#else
> + int flags[2] = { FF_MM_MMX };
> + int flags_size = 1;
> +#endif
it seems int flags[2] does noz need to be changed
>
> for(;;) {
> c = getopt(argc, argv, "h");
> @@ -145,7 +152,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++) {
hmm, this changes it from 1 to 2
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090409/48a831c9/attachment.pgp>
More information about the ffmpeg-devel
mailing list