[FFmpeg-cvslog] r32052 - trunk/libswscale/utils.c
ramiro
subversion
Mon Sep 6 16:42:25 CEST 2010
Author: ramiro
Date: Mon Sep 6 16:42:25 2010
New Revision: 32052
Log:
swscale: also update flags on sws_getCachedContext()
Modified:
trunk/libswscale/utils.c
Modified: trunk/libswscale/utils.c
==============================================================================
--- trunk/libswscale/utils.c Mon Sep 6 04:02:53 2010 (r32051)
+++ trunk/libswscale/utils.c Mon Sep 6 16:42:25 2010 (r32052)
@@ -720,6 +720,15 @@ static int handle_jpeg(enum PixelFormat
}
}
+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
__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(
if (!param)
param = default_param;
+ flags = update_flags_cpu(flags);
+
if (context &&
(context->srcW != srcW ||
context->srcH != srcH ||
More information about the ffmpeg-cvslog
mailing list