[FFmpeg-devel] [PATCH] Fix ffmpeg crash on G3 based computers introduced with revision 10637

Reimar Döffinger Reimar.Doeffinger
Sat Feb 9 13:22:51 CET 2008


Hello,
On Sat, Feb 09, 2008 at 12:11:01PM +0000, Patrice Bensoussan wrote:
> It seems that ffmpeg is trying to use altivec on PowerPC G3 although it's 
> not available. This was introduced with revision 10637. Here is a patch to 
> fix the issue.
>
> Patrice
>

> Index: libavcodec/mpegvideo.c
> ===================================================================
> --- libavcodec/mpegvideo.c	(revision 11880)
> +++ libavcodec/mpegvideo.c	(working copy)
> @@ -61,6 +61,10 @@
>  extern void XVMC_decode_mb(MpegEncContext *s);
>  #endif
>  
> +#ifdef HAVE_ALTIVEC
> +extern int has_altivec(void);
> +#endif

That #ifdef is pointless.

> @@ -152,7 +156,8 @@
>  #elif defined(ARCH_ARMV4L)
>      MPV_common_init_armv4l(s);
>  #elif defined(HAVE_ALTIVEC)
> -    MPV_common_init_altivec(s);
> +    if ( has_altivec() )
> +        MPV_common_init_altivec(s);

And IMO this check belongs into the MPV_common_init_altivec, if for no
other reason than that there are different levels of altivec support and
it's easier to add checks with finer granularity in that function than
here.

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list