diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-29 15:30:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-30 21:34:29 +0100 |
commit | 21c4afa6223dba58f604b4f5613b0a8a4a7d24ee (patch) | |
tree | 73030c32f45e08a5c81dbb38f32ae2a6b7a6a0b3 /avmedia/source | |
parent | 1feed2622e99321e0893c8dc0443a534b5905691 (diff) |
loplugin:mergeclasses SoundHandler
replace ThreadHelpBase with MutexHelper
Change-Id: If971a701261164ff4d3871eab5dfebd2c5d5b89f
Reviewed-on: https://gerrit.libreoffice.org/84111
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'avmedia/source')
-rw-r--r-- | avmedia/source/framework/soundhandler.cxx | 9 | ||||
-rw-r--r-- | avmedia/source/framework/soundhandler.hxx | 9 |
2 files changed, 5 insertions, 13 deletions
diff --git a/avmedia/source/framework/soundhandler.cxx b/avmedia/source/framework/soundhandler.cxx index c98de6051796..926671f64c69 100644 --- a/avmedia/source/framework/soundhandler.cxx +++ b/avmedia/source/framework/soundhandler.cxx @@ -119,11 +119,8 @@ css::uno::Sequence< OUString > SAL_CALL SoundHandler::getSupportedServiceNames() @threadsafe yes *//*-*************************************************************************************************************/ SoundHandler::SoundHandler() - // Init baseclasses first - : ThreadHelpBase ( ) - , ::cppu::OWeakObject ( ) // Init member - , m_bError ( false ) + : m_bError ( false ) , m_aUpdateIdle ( "avmedia SoundHandler Update" ) { m_aUpdateIdle.SetInvokeHandler(LINK(this, SoundHandler, implts_PlayerNotify)); @@ -168,7 +165,7 @@ void SAL_CALL SoundHandler::dispatchWithNotification(const css::util::URL& const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) { // SAFE { - const ::osl::MutexGuard aLock( m_aLock ); + const ::osl::MutexGuard aLock( GetMutex() ); utl::MediaDescriptor aDescriptor(lDescriptor); @@ -280,7 +277,7 @@ OUString SAL_CALL SoundHandler::detect( css::uno::Sequence< css::beans::Property IMPL_LINK_NOARG(SoundHandler, implts_PlayerNotify, Timer *, void) { // SAFE { - ::osl::ClearableMutexGuard aLock( m_aLock ); + ::osl::ClearableMutexGuard aLock( GetMutex() ); if (m_xPlayer.is() && m_xPlayer->isPlaying() && m_xPlayer->getMediaTime() < m_xPlayer->getDuration()) { diff --git a/avmedia/source/framework/soundhandler.hxx b/avmedia/source/framework/soundhandler.hxx index 0cc3de24e83b..256b59b19ccf 100644 --- a/avmedia/source/framework/soundhandler.hxx +++ b/avmedia/source/framework/soundhandler.hxx @@ -36,17 +36,12 @@ #include <vcl/timer.hxx> #include <vcl/idle.hxx> #include <tools/link.hxx> +#include <toolkit/helper/mutexhelper.hxx> #include <avmedia/mediawindow.hxx> #include <osl/mutex.hxx> namespace avmedia{ -struct ThreadHelpBase -{ - public: - mutable ::osl::Mutex m_aLock; -}; - /*-************************************************************************************************************ @short handler to detect and play sounds ("wav" and "au" only!) @descr Register this implementation as a content handler to detect and/or play wav- and au-sounds. @@ -65,7 +60,7 @@ class SoundHandler : // interfaces , public css::document::XExtendedFilterDetection // baseclasses // Order is necessary for right initialization! - , private ThreadHelpBase + , private MutexHelper , public ::cppu::OWeakObject { // public methods |