Skip to content

Commit

Permalink
allow compiling ffmpeg on non x86 platforms
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dfries committed Nov 18, 2012
1 parent dfff979 commit 341bf3d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 341bf3d

Please sign in to comment.