summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-03-23 11:11:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-23 19:49:25 +0000
commite7dbef922a2fc73469f12c520bcc1af54fe038fb (patch)
tree02c18e1d1c9d0d85914626f66ace24a79f892e79 /avmedia
parent462ebbd10bd537f42104fe991a0aeebcd563f178 (diff)
rtl::Static to thread-safe-static
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/gstreamer/gstplayer.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index b841c576be17..0bd3485efd9a 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -245,13 +245,15 @@ IMPL_STATIC_LINK(MissingPluginInstaller, launchUi, void *, p, void)
}
-struct TheMissingPluginInstaller:
- public rtl::Static<MissingPluginInstaller, TheMissingPluginInstaller>
-{};
+MissingPluginInstaller& TheMissingPluginInstaller()
+{
+ static MissingPluginInstaller theInstaller;
+ return theInstaller;
+}
void MissingPluginInstallerThread::execute() {
- MissingPluginInstaller & inst = TheMissingPluginInstaller::get();
+ MissingPluginInstaller & inst = TheMissingPluginInstaller();
for (;;) {
std::vector<OString> details;
{
@@ -330,7 +332,7 @@ Player::~Player()
void SAL_CALL Player::disposing()
{
- TheMissingPluginInstaller::get().detach(this);
+ TheMissingPluginInstaller().detach(this);
::osl::MutexGuard aGuard(m_aMutex);
@@ -532,7 +534,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
maSizeCondition.set();
}
} else if (gst_is_missing_plugin_message(message)) {
- TheMissingPluginInstaller::get().report(this, message);
+ TheMissingPluginInstaller().report(this, message);
if( mnWidth == 0 ) {
// an error occurred, set condition so that OOo thread doesn't wait for us
maSizeCondition.set();