[FFmpeg-devel] [PATCH] Fix XvMC

Ivan Kalvachev ikalvachev
Sun Oct 11 20:51:49 CEST 2009


On 10/11/09, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, Oct 10, 2009 at 05:17:59PM +0200, Gwenole Beauchesne wrote:
>> Hi,
>>
>> This patch fixes a crash with XvMC... According to online bug reports,
>> this
>> affects all platforms (AMD, Intel, NVIDIA). XVMCCreateBlocks() may not
>> allocate 16-byte aligned blocks so an SSE optimized clear_blocks() could
>> crash on platforms not supporting MSSE. Besides, since the XvMC decode
>> context initialization is a mixture of FFmpeg and player parts, we can't
>> expect players to fix that. By chance, this generally is a driver
>> limitation anyway. So a fix in FFmpeg is the better approach IMHO.
>>
>> Another solution is to set xvmc_acceleration to 1, this doesn't make a
>> real
>> difference though my platform is recent enough.
>
> iam not xvmc maintainer but i consider it a driver bug if the driver does
> not
> align arrays as is needed on the architecture
> final decission is ivans but i am against disabling optimizations, rather
> print an error pointing the user to his drivers being buggy and maybe
> suggest him to try a different acceleration architecture that has less
> buggy drivers or if one prefers to argue it the other way around, a less
> buggy API specification.

I'm ok with this hack.

I would also accept patch that prints message,
but it must appear only once.

About the hack, it only disables SSE when xvmc is used
and even then the fallback is to MMX function. It should
have same speed on all pre-coreduo CPU's.

However if we run into another SSE problem (e.g. IDCT)
then the other solution must be used. I was thinking of
detecting the alignment at xvmc_field_start() and
dynamically switching xvmc_acceleration to the slowest mode.
(On SSE machine).



More information about the ffmpeg-devel mailing list