From 8cc566a536eb027bf5818c08526ce51632c63003 Mon Sep 17 00:00:00 2001 From: Simon Danner Date: Sun, 3 Aug 2014 07:23:35 +0200 Subject: avmedia/gstreamer: use GST_SECOND use GST_SECOND instead of magic value Change-Id: I992ecbab458f113a75658b1ff69df60068324509 Reviewed-on: https://gerrit.libreoffice.org/10705 Reviewed-by: David Tardon Tested-by: David Tardon --- avmedia/source/gstreamer/gstframegrabber.cxx | 2 +- avmedia/source/gstreamer/gstplayer.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'avmedia') diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index acf025248506..71f1bf7b3298 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -112,7 +112,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe if( !mpPipeline ) return xRet; - gint64 gst_position = llround( fMediaTime * 1E9 ); + gint64 gst_position = llround( fMediaTime * GST_SECOND ); gst_element_seek_simple( mpPipeline, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_FLUSH), diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index c89d423a64cd..ceea8e21e774 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -455,7 +455,7 @@ double SAL_CALL Player::getDuration() double duration = 0.01; if( mpPlaybin && mnDuration > 0 ) { - duration = mnDuration / 1E9; + duration = mnDuration / GST_SECOND; } return duration; @@ -469,7 +469,7 @@ void SAL_CALL Player::setMediaTime( double fTime ) ::osl::MutexGuard aGuard(m_aMutex); if( mpPlaybin ) { - gint64 gst_position = llround (fTime * 1E9); + gint64 gst_position = llround (fTime * GST_SECOND); gst_element_seek( mpPlaybin, 1.0, GST_FORMAT_TIME, @@ -496,7 +496,7 @@ double SAL_CALL Player::getMediaTime() // get current position in the stream gint64 gst_position; if( wrap_element_query_position( mpPlaybin, GST_FORMAT_TIME, &gst_position ) ) - position = gst_position / 1E9; + position = gst_position / GST_SECOND; } return position; -- cgit