Kaydet (Commit) 054c2b6a authored tarafından Minh Ngo's avatar Minh Ngo Kaydeden (comit) Michael Meeks

Fixing segfault when getting a duration

Change-Id: I51e221214bb7e6c09312109ddb9d6bb71b47b181
üst e2376b3d
#include <vcl/graph.hxx>
#include "vlcframegrabber.hxx"
using namespace ::com::sun::star;
......@@ -14,6 +15,7 @@ SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
::uno::Reference< css::graphic::XGraphic > SAL_CALL VLCFrameGrabber::grabFrame( double fMediaTime )
{
return Graphic().GetXGraphic();
}
::rtl::OUString SAL_CALL VLCFrameGrabber::getImplementationName()
......
......@@ -34,6 +34,7 @@ VLCPlayer::VLCPlayer( const rtl::OUString& url )
, mPlayer( libvlc_media_player_new(mInstance.get()), libvlc_media_player_release )
, mMedia( initMedia( url, mInstance), libvlc_media_release )
{
libvlc_media_player_set_media( mPlayer.get(), mMedia.get() );
}
void SAL_CALL VLCPlayer::start()
......@@ -57,8 +58,7 @@ void SAL_CALL VLCPlayer::stop()
double SAL_CALL VLCPlayer::getDuration()
{
::osl::MutexGuard aGuard(m_aMutex);
libvlc_media_t* media = libvlc_media_player_get_media( mPlayer.get() );
return libvlc_media_get_duration( media );
return libvlc_media_get_duration( mMedia.get() );
}
void SAL_CALL VLCPlayer::setMediaTime( double fTime )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment