summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Ngo <nlminhtl@gmail.com>2013-07-10 08:52:41 +0300
committerMichael Meeks <michael.meeks@suse.com>2013-07-26 07:11:50 +0100
commit4d502f67298e5b8f6039266c1c502be3d5a04088 (patch)
treee8bd44293036f39f4842943de2ceab318977c319
parentbdb0d5c3e0d4a47c8863608641ff18dbacfdfe46 (diff)
Fixing get/set time methods (correctly converts ms into sec).
Change-Id: I64c7ddb5336a7ea255500c21ee1550eb32cbf27b
-rw-r--r--avmedia/source/vlc/vlcframegrabber.cxx1
-rw-r--r--avmedia/source/vlc/vlcframegrabber.hxx3
-rw-r--r--avmedia/source/vlc/vlcplayer.cxx8
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()