aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorS. Davilla <davilla@4pi.com>2011-04-12 13:33:37 -0400
committerS. Davilla <davilla@4pi.com>2011-04-12 18:19:25 -0400
commit7ad877bea931df90e96a4261c35fb73538117b16 (patch)
tree437b827c728cf3d50ec76edf81b0a611bfbe9f1d
parent2823bff31cadde647e334abd9d92613f8fe19a0e (diff)
clean up sdl mutex includes and add XBMC_MUTEX
-rw-r--r--xbmc/Application.cpp16
-rw-r--r--xbmc/Application.h2
-rw-r--r--xbmc/linux/XEventUtils.cpp3
-rw-r--r--xbmc/system.h1
-rw-r--r--xbmc/threads/Makefile1
5 files changed, 13 insertions, 10 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 68d4d74d15..42e7421a2b 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -324,7 +324,7 @@ CApplication::CApplication(void) : m_itemCurrentFile(new CFileItem), m_progressT
#endif
m_currentStack = new CFileItemList;
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
m_frameCount = 0;
m_frameMutex = SDL_CreateMutex();
m_frameCond = SDL_CreateCond();
@@ -347,7 +347,7 @@ CApplication::~CApplication(void)
delete m_pKaraokeMgr;
#endif
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
if (m_frameMutex)
SDL_DestroyMutex(m_frameMutex);
@@ -1905,7 +1905,7 @@ void CApplication::RenderScreenSaver()
bool CApplication::WaitFrame(unsigned int timeout)
{
bool done = false;
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
// Wait for all other frames to be presented
SDL_mutexP(m_frameMutex);
//wait until event is set, but modify remaining time
@@ -1943,7 +1943,7 @@ bool CApplication::WaitFrame(unsigned int timeout)
void CApplication::NewFrame()
{
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
// We just posted another frame. Keep track and notify.
SDL_mutexP(m_frameMutex);
m_frameCount++;
@@ -1985,7 +1985,7 @@ void CApplication::Render()
m_bPresentFrame = false;
if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused())
{
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
SDL_mutexP(m_frameMutex);
//wait until event is set, but modify remaining time
@@ -2090,7 +2090,7 @@ void CApplication::Render()
g_renderManager.UpdateResolution();
g_renderManager.ManageCaptures();
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
SDL_mutexP(m_frameMutex);
if(m_frameCount > 0 && decrement)
m_frameCount--;
@@ -5227,7 +5227,7 @@ bool CApplication::SwitchToFullScreen()
// See if we're playing a video, and are in GUI mode
if ( IsPlayingVideo() && g_windowManager.GetActiveWindow() != WINDOW_FULLSCREEN_VIDEO)
{
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
// Reset frame count so that timing is FPS will be correct.
SDL_mutexP(m_frameMutex);
m_frameCount = 0;
@@ -5404,7 +5404,7 @@ bool CApplication::IsCurrentThread() const
bool CApplication::IsPresentFrame()
{
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__)) //TODO:DIRECTX
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
SDL_mutexP(m_frameMutex);
bool ret = m_bPresentFrame;
SDL_mutexV(m_frameMutex);
diff --git a/xbmc/Application.h b/xbmc/Application.h
index 2aa552474e..b5b0511b46 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -355,7 +355,7 @@ protected:
CGUITextLayout *m_debugLayout;
-#if defined(HAS_SDL) || (defined(__APPLE__) && defined(__arm__))
+#if defined(HAS_SDL) || defined(HAS_XBMC_MUTEX)
int m_frameCount;
SDL_mutex* m_frameMutex;
SDL_cond* m_frameCond;
diff --git a/xbmc/linux/XEventUtils.cpp b/xbmc/linux/XEventUtils.cpp
index 61cf9527c8..05b759c5d6 100644
--- a/xbmc/linux/XEventUtils.cpp
+++ b/xbmc/linux/XEventUtils.cpp
@@ -23,7 +23,8 @@
#include "PlatformDefs.h"
#include "XEventUtils.h"
#include "XHandle.h"
-#include "../utils/log.h"
+#include "utils/log.h"
+#include "threads/XBMC_mutex.h"
using namespace std;
diff --git a/xbmc/system.h b/xbmc/system.h
index 014f6e99aa..7df1185b48 100644
--- a/xbmc/system.h
+++ b/xbmc/system.h
@@ -102,6 +102,7 @@
#ifdef __APPLE__
#if defined(__arm__)
#undef HAS_SDL
+ #define HAS_XBMC_MUTEX
#else
#define HAS_GL
#define HAS_SDL_AUDIO
diff --git a/xbmc/threads/Makefile b/xbmc/threads/Makefile
index 9cf8f64dfa..7c6a22d4e8 100644
--- a/xbmc/threads/Makefile
+++ b/xbmc/threads/Makefile
@@ -7,6 +7,7 @@ SRCS=Atomics.cpp \
SharedSection.cpp \
SingleLock.cpp \
Thread.cpp \
+ XBMC_mutex.cpp \
LIB=threads.a