summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-05-28 15:38:22 +0200
committerJan Holesovsky <kendy@collabora.com>2014-05-27 14:54:24 +0200
commit91fb0866cad2518e5f2cbc48af0e952282fee19d (patch)
treefe017d250f6a1636b64bdcce2fd0f3981b9be51f /avmedia
parentfa551c422426962194b6bff4234f12eb5bdf57ca (diff)
Use AutoTimer instead of Timer, and add some more locking.
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 22ff457f8bae..fefbb314518c 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -31,6 +31,7 @@ OGLPlayer::OGLPlayer()
OGLPlayer::~OGLPlayer()
{
+ osl::MutexGuard aGuard(m_aMutex);
if( m_pHandle )
{
for (size_t i = 0; i < m_pHandle->size; ++i)
@@ -63,6 +64,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
@@ -297,8 +300,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 b41df21e5001..42476fc916a4 100644
--- a/avmedia/source/opengl/oglplayer.hxx
+++ b/avmedia/source/opengl/oglplayer.hxx
@@ -62,7 +62,7 @@ private:
OUString m_sURL;
glTFHandle* m_pHandle;
OpenGLContext m_aContext;
- Timer m_aTimer;
+ AutoTimer m_aTimer;
OGLWindow* m_pOGLWindow;
};