[FFmpeg-devel] PATCH Fix SSE core-dumps when decoding AAC on optimized ffmpeg with shared libraries compiled under Mingw (win32)
Wed Oct 22 20:33:03 CEST 2008
On Wed, Oct 22, 2008 at 4:27 PM, Art Clarke <aclarke at vlideshow.com> wrote:
> Hi folks,
> Attached is a patch that fixes a bug where ACC decoding fails with the
> new decoder. To reproduce, build ffmpeg in SHARED library mode on
> Mingw with the latest runtime and win32 library, with all
> optimizations turned on, and then try to decode an aac file on a
> machine with the SSE2 instruction set available (how's that for
> ffmpeg -i aacfile.aac -acodec pcm_mulaw -y out.wav
> The problem is that the GCC compiler on mingw doesn't correctly align
> uninitialized local variables in mingw. This causes some of the SSE
> optimizations under the new AAC decoder to work on non-64-bit aligned
> local variables and badness occurs.
> The fix is to pass "-fno-common" to the GCC compiler under mingw if
> mmx2 is enabled. This allows assembly that tries to align
> uninitialized local variables on 64 bit boundaries at the cost of not
> allowing you to define an uninitialized variable with extern linkage
> more than once (without specifying at all but one instances as extern
> -- something ffmpeg already enforces)*.
> Major major kudos to Gianluigi Tiesi for figuring this out with the
> GCC team. He's been working on getting mplayer to compile on Mingw.
> See here for the details on the GCC bug and "-fno-common" workaround:
and you're done...
Your patch will do more harm than good once gcc/binutils are fixed on MinGW.
Still, thanks for Gianluigi Tiese for finding that out.
More information about the ffmpeg-devel