diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2010-09-06 14:42:25 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2010-09-06 14:42:25 +0000 |
commit | c17f5a4e154b19d9bdcc8274dba2bac2684b1301 (patch) | |
tree | 9a471c52c7af9af45a47868a82662cc015f71c1f /libswscale | |
parent | a1899e0adc0761eec627fa53eda49a4912bb46ae (diff) | |
download | ffmpeg-c17f5a4e154b19d9bdcc8274dba2bac2684b1301.tar.gz |
swscale: also update flags on sws_getCachedContext()
Originally committed as revision 32052 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/utils.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 35e11269e7..e9400f8b02 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -720,6 +720,15 @@ static int handle_jpeg(enum PixelFormat *format) } } +static int update_flags_cpu(int flags) +{ +#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off + flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN); + flags |= ff_hardcodedcpuflags(); +#endif /* CONFIG_RUNTIME_CPUDETECT */ + return flags; +} + SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) @@ -735,10 +744,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, __asm__ volatile("emms\n\t"::: "memory"); #endif -#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off - flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN); - flags |= ff_hardcodedcpuflags(); -#endif /* CONFIG_RUNTIME_CPUDETECT */ + flags = update_flags_cpu(flags); if (!rgb15to16) sws_rgb2rgb_init(flags); unscaled = (srcW == dstW && srcH == dstH); @@ -1509,6 +1515,8 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context, if (!param) param = default_param; + flags = update_flags_cpu(flags); + if (context && (context->srcW != srcW || context->srcH != srcH || |