aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2010-09-06 14:42:25 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2010-09-06 14:42:25 +0000
commitc17f5a4e154b19d9bdcc8274dba2bac2684b1301 (patch)
tree9a471c52c7af9af45a47868a82662cc015f71c1f /libswscale
parenta1899e0adc0761eec627fa53eda49a4912bb46ae (diff)
downloadffmpeg-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.c16
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 ||