summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Ngo <nlminhtl@gmail.com>2013-07-08 22:31:10 +0300
committerMinh Ngo <nlminhtl@gmail.com>2013-07-08 22:31:10 +0300
commit225eff2e1948b294f8bd5e908b6e4ae245593ce0 (patch)
tree7bf44f62a3ffa4c6889afeca3b7848285c8924ad
parentb7d782570c7fb732837446bdfd5ee71e47a9c64b (diff)
Fixing segfault when getting a duration
Change-Id: I51e221214bb7e6c09312109ddb9d6bb71b47b181
-rw-r--r--avmedia/source/vlc/vlcframegrabber.cxx2
-rw-r--r--avmedia/source/vlc/vlcplayer.cxx4
2 files changed, 4 insertions, 2 deletions
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 6e8ab1338ee0..11151b6a6926 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 a8eda3e87aff..efb23baacd8f 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 )