codec: Fixed NEON CPU detection compile issue, primitives_get race condition in rfx decoding

This commit is contained in:
Martin Fleisz 2013-02-22 03:37:39 -08:00
parent 1cfb4a4e77
commit b8fd4b5227
2 changed files with 7 additions and 1 deletions

View File

@ -71,7 +71,7 @@ if(WITH_NEON)
if(ANDROID)
set(ANDROID_CPU_FEATURES_PATH "${ANDROID_NDK}/sources/android/cpufeatures")
include_directories(${ANDROID_CPU_FEATURES_PATH})
set(${MODULE_PREFIX}_NEON_SRCS ${${MODULE_PREFIX}_NEON_SRCS}
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS}
${ANDROID_CPU_FEATURES_PATH}/cpu-features.c
${ANDROID_CPU_FEATURES_PATH}/cpu-features.h)
endif()

View File

@ -37,6 +37,7 @@
#include <freerdp/codec/rfx.h>
#include <freerdp/constants.h>
#include <freerdp/primitives.h>
#include "rfx_constants.h"
#include "rfx_types.h"
@ -204,6 +205,11 @@ RFX_CONTEXT* rfx_context_new(void)
if (context->priv->UseThreads)
{
/* Call primitives_get here in order to avoid race conditions when using primitives_get */
/* from multiple threads. This call will initialize all function pointers correctly */
/* before any decoding threads are started */
primitives_get();
context->priv->ThreadPool = CreateThreadpool(NULL);
InitializeThreadpoolEnvironment(&context->priv->ThreadPoolEnv);
SetThreadpoolCallbackPool(&context->priv->ThreadPoolEnv, context->priv->ThreadPool);