Use getXWeak in avmedia

Change-Id: I1dc1e597c50b0081375b9216ac4e6436b84aaa0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150832
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2023-04-23 20:12:49 +03:00
parent 32122e8931
commit 1df99a2155
2 changed files with 3 additions and 3 deletions

View file

@ -195,7 +195,7 @@ void SAL_CALL SoundHandler::dispatchWithNotification(const css::util::URL&
m_xPlayer.set( avmedia::MediaWindow::createPlayer( aURL.Complete, aDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_REFERRER, OUString()) ), css::uno::UNO_SET_THROW );
// OK- we can start async playing ...
// Count this request and initialize self-holder against dying by uno ref count ...
m_xSelfHold.set(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY);
m_xSelfHold.set(getXWeak());
m_xPlayer->start();
m_aUpdateIdle.SetPriority( TaskPriority::HIGH_IDLE );
m_aUpdateIdle.Start();

View file

@ -163,7 +163,7 @@ void GtkPlayer::notifyListeners()
return;
css::lang::EventObject aEvent;
aEvent.Source = static_cast<cppu::OWeakObject*>(this);
aEvent.Source = getXWeak();
comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer);
while (pIterator.hasMoreElements())
@ -374,7 +374,7 @@ GtkPlayer::addPlayerListener(const css::uno::Reference<css::media::XPlayerListen
if (gtk_media_stream_is_prepared(m_pStream))
{
css::lang::EventObject aEvent;
aEvent.Source = static_cast<cppu::OWeakObject*>(this);
aEvent.Source = getXWeak();
rListener->preferredPlayerWindowSizeAvailable(aEvent);
}
else