diff options
author | Minh Ngo <nlminhtl@gmail.com> | 2013-07-10 08:52:41 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-07-26 10:50:22 +0100 |
commit | 057b2b6b7faebe3572b6993859eb1a0f7424c6eb (patch) | |
tree | 3b6f631fc8759e62a605b81e0a0b37685d306fff /avmedia | |
parent | 5b67ee9c432745119f9c9740f88a3da17280e4b6 (diff) |
Fixing get/set time methods (correctly converts ms into sec).
Change-Id: I64c7ddb5336a7ea255500c21ee1550eb32cbf27b
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/vlc/vlcframegrabber.cxx | 1 | ||||
-rw-r--r-- | avmedia/source/vlc/vlcframegrabber.hxx | 3 | ||||
-rw-r--r-- | avmedia/source/vlc/vlcplayer.cxx | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx index 4cf986642236..5cf76ec94088 100644 --- a/avmedia/source/vlc/vlcframegrabber.cxx +++ b/avmedia/source/vlc/vlcframegrabber.cxx @@ -10,6 +10,7 @@ const ::rtl::OUString AVMEDIA_VLC_GRABBER_IMPLEMENTATIONNAME = "com.sun.star.com const ::rtl::OUString AVMEDIA_VLC_GRABBER_SERVICENAME = "com.sun.star.media.VLCFrameGrabber_VLC"; SAL_CALL VLCFrameGrabber::VLCFrameGrabber() + : FrameGrabber_BASE() { } diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx index 0e88d5dca198..cb77e41c06c4 100644 --- a/avmedia/source/vlc/vlcframegrabber.hxx +++ b/avmedia/source/vlc/vlcframegrabber.hxx @@ -21,6 +21,7 @@ #define _VLCFRAMEGRABBER_HXX #include "vlccommon.hxx" +#include <boost/noncopyable.hpp> #include <com/sun/star/media/XFrameGrabber.hpp> #include <cppuhelper/implbase2.hxx> @@ -30,7 +31,7 @@ namespace vlc { typedef ::cppu::WeakImplHelper2< ::com::sun::star::media::XFrameGrabber, ::com::sun::star::lang::XServiceInfo > FrameGrabber_BASE; -class VLCFrameGrabber : public FrameGrabber_BASE +class VLCFrameGrabber : public FrameGrabber_BASE, boost::noncopyable { public: SAL_CALL VLCFrameGrabber(); diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx index efb23baacd8f..3c8453ba3086 100644 --- a/avmedia/source/vlc/vlcplayer.cxx +++ b/avmedia/source/vlc/vlcplayer.cxx @@ -18,6 +18,8 @@ const char * const VLC_ARGS[] = { "--quiet" }; +const int MS_IN_SEC = 1000; // Millisec in sec + namespace { libvlc_media_t* initMedia( const rtl::OUString& url, boost::shared_ptr<libvlc_instance_t>& instance ) @@ -58,19 +60,19 @@ void SAL_CALL VLCPlayer::stop() double SAL_CALL VLCPlayer::getDuration() { ::osl::MutexGuard aGuard(m_aMutex); - return libvlc_media_get_duration( mMedia.get() ); + return static_cast<double>( libvlc_media_get_duration( mMedia.get() ) ) / MS_IN_SEC; } void SAL_CALL VLCPlayer::setMediaTime( double fTime ) { ::osl::MutexGuard aGuard(m_aMutex); - libvlc_media_player_set_time( mPlayer.get(), fTime ); + libvlc_media_player_set_time( mPlayer.get(), fTime * MS_IN_SEC ); } double SAL_CALL VLCPlayer::getMediaTime() { ::osl::MutexGuard aGuard(m_aMutex); - return libvlc_media_player_get_time( mPlayer.get() ); + return static_cast<double>( libvlc_media_player_get_time( mPlayer.get() ) ) / MS_IN_SEC; } double SAL_CALL VLCPlayer::getRate() |