Commit c17f5a4e authored by Ramiro Polla's avatar Ramiro Polla

swscale: also update flags on sws_getCachedContext()

Originally committed as revision 32052 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent a1899e0a
...@@ -720,6 +720,15 @@ static int handle_jpeg(enum PixelFormat *format) ...@@ -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, SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
int dstW, int dstH, enum PixelFormat dstFormat, int flags, int dstW, int dstH, enum PixelFormat dstFormat, int flags,
SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
...@@ -735,10 +744,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, ...@@ -735,10 +744,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
__asm__ volatile("emms\n\t"::: "memory"); __asm__ volatile("emms\n\t"::: "memory");
#endif #endif
#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off flags = update_flags_cpu(flags);
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 */
if (!rgb15to16) sws_rgb2rgb_init(flags); if (!rgb15to16) sws_rgb2rgb_init(flags);
unscaled = (srcW == dstW && srcH == dstH); unscaled = (srcW == dstW && srcH == dstH);
...@@ -1509,6 +1515,8 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context, ...@@ -1509,6 +1515,8 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
if (!param) if (!param)
param = default_param; param = default_param;
flags = update_flags_cpu(flags);
if (context && if (context &&
(context->srcW != srcW || (context->srcW != srcW ||
context->srcH != srcH || context->srcH != srcH ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment