[Libreoffice-commits] core.git: Branch 'feature/vlc' - avmedia/source
Minh Ngo
nlminhtl at gmail.com
Mon Jul 8 12:32:01 PDT 2013
avmedia/source/vlc/vlcframegrabber.cxx | 2 ++
avmedia/source/vlc/vlcplayer.cxx | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 225eff2e1948b294f8bd5e908b6e4ae245593ce0
Author: Minh Ngo <nlminhtl at gmail.com>
Date: Mon Jul 8 22:31:10 2013 +0300
Fixing segfault when getting a duration
Change-Id: I51e221214bb7e6c09312109ddb9d6bb71b47b181
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 6e8ab13..11151b6 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -1,3 +1,4 @@
+#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()
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index a8eda3e..efb23ba 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -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 )
More information about the Libreoffice-commits
mailing list