diff options
author | Minh Ngo <nlminhtl@gmail.com> | 2013-07-08 22:31:10 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-07-26 10:50:21 +0100 |
commit | 054c2b6a51faac2b6c32c02f567a496537a15555 (patch) | |
tree | 67d4683ae9f08cecb5a26c5c3b59c0e2565a852b /avmedia | |
parent | e2376b3db0050cb3a9f902aeaa9616d00945011e (diff) |
Fixing segfault when getting a duration
Change-Id: I51e221214bb7e6c09312109ddb9d6bb71b47b181
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/vlc/vlcframegrabber.cxx | 2 | ||||
-rw-r--r-- | avmedia/source/vlc/vlcplayer.cxx | 4 |
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 ) |