From 341bf3d6b3be3f7b99185a5a283780b241a9722a Mon Sep 17 00:00:00 2001 From: David Fries Date: Tue, 13 Nov 2012 00:07:22 -0600 Subject: [PATCH] allow compiling ffmpeg on non x86 platforms The assembly instruction emms is only available on the x86 platform and given the existing __SSE_MATH__ check it is not required when the compiler is using sse for floating point math. Add a check to only enable when not using __SSE_MATH__ and when mmx is available with __pentium_mmx__ In my case the instruction doesn't compile on arm. --- CHANGELOG | 1 + CREDITS | 1 + ffmpeg.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 44c1ea1..b13e37c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -85,6 +85,7 @@ Bugfixes * Fixed leak in vloopback. * Fixed a build of motion for some kernel version with not good videodev.h * Fix webhttpd race condition crash with SIGHUP, add it to running thread counter (David Fries) + * Limit asm emms call to allow compiling on non x86 (ARM) systems (David Fries) 3.2.12 Summary of Changes diff --git a/CREDITS b/CREDITS index 02434b1..87b70db 100644 --- a/CREDITS +++ b/CREDITS @@ -477,6 +477,7 @@ David Fries * Fix webhttpd race condition crash with SIGHUP, add it to running thread counter * Allow text format specifiers to take a width like printf would. * Add power_line_frequency configuration item to improve image quality. + * Limit asm emms call to allow compiling on non x86 (ARM) systems Aaron Gage * Pointed me to the vid_mmap/int problem when calling SYNC in diff --git a/ffmpeg.c b/ffmpeg.c index 6dd68e8..c82e8c0 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1000,7 +1000,8 @@ void ffmpeg_deinterlace(unsigned char *img, int width, int height) /* We assume using 'PIX_FMT_YUV420P' always */ avpicture_deinterlace(&picture, &picture, PIX_FMT_YUV420P, width, height); -#ifndef __SSE_MATH__ +#if !defined(__SSE_MATH__) && defined(__pentium_mmx__) + /* re-allow floating point operations, x86-32 only */ __asm__ __volatile__ ( "emms"); #endif