summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-05-28 15:38:22 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-06-11 19:27:29 +0200
commit5d0ede279d68bbb1dee2a5bfe9651e605f2a62cc (patch)
tree7812227d1a6d56b3df41c661045bf5ccecca88da /avmedia
parentefc5aaf1ff68f93cdeb4e69ce2c6c374c19de67e (diff)
Use AutoTimer instead of Timer, and add some more locking.
(cherry picked from commit 91fb0866cad2518e5f2cbc48af0e952282fee19d) Conflicts: avmedia/source/opengl/oglplayer.cxx Change-Id: I83a99e333a6c62bf7779e3fbbcc3e5af38bb2ca5
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/opengl/oglplayer.cxx5
-rw-r--r--avmedia/source/opengl/oglplayer.hxx2
2 files changed, 5 insertions, 2 deletions
diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx
index f2e80d209be7..b626bf2670db 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -30,6 +30,7 @@ OGLPlayer::OGLPlayer()
OGLPlayer::~OGLPlayer()
{
+ osl::MutexGuard aGuard(m_aMutex);
gltf_renderer_release(m_pHandle);
}
@@ -52,6 +53,8 @@ static bool lcl_LoadFile( glTFFile* io_pFile, const OUString& rURL)
bool OGLPlayer::create( const OUString& rURL )
{
+ osl::MutexGuard aGuard(m_aMutex);
+
m_sURL = rURL;
// Load *.json file and init renderer
@@ -267,8 +270,8 @@ IMPL_LINK(OGLPlayer,TimerHandler,Timer*,pTimer)
{
if (pTimer == &m_aTimer)
{
+ osl::MutexGuard aGuard(m_aMutex);
m_pOGLWindow->update();
- m_aTimer.Start();
}
return 0;
diff --git a/avmedia/source/opengl/oglplayer.hxx b/avmedia/source/opengl/oglplayer.hxx
index 69f010ba8719..e7da91e002e7 100644
--- a/avmedia/source/opengl/oglplayer.hxx
+++ b/avmedia/source/opengl/oglplayer.hxx
@@ -63,7 +63,7 @@ private:
OUString m_sURL;
glTFHandle* m_pHandle;
OpenGLContext m_aContext;
- Timer m_aTimer;
+ AutoTimer m_aTimer;
OGLWindow* m_pOGLWindow;
};