summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-08-18 08:22:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-08-18 08:22:16 +0200
commit26821b7e2eff4a7db22606f70daa3f3d442f7525 (patch)
treea4a200aae77034d7e5d61dc914ca5c3a85b6c0d8
parent6b7c23b3fb6175c04fcc3f1e12b34bedf5f4e5f8 (diff)
tdf#84323: Make osl::Condition::wait more readable
Change-Id: Icd66ae1d390100549f903d45b2896cdcdca449be
-rw-r--r--avmedia/source/gstreamer/gstplayer.cxx4
-rw-r--r--avmedia/source/vlc/vlcframegrabber.cxx5
-rw-r--r--include/osl/conditn.hxx4
3 files changed, 8 insertions, 5 deletions
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index eb64d1d870d6..42828335819b 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -21,6 +21,7 @@
#include <algorithm>
#include <cassert>
+#include <chrono>
#include <cstddef>
#include <cstring>
#include <map>
@@ -854,11 +855,10 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize()
DBG( "%p pre-Player::getPreferredPlayerWindowSize, member %d x %d", this, mnWidth, mnHeight );
- TimeValue aTimeout = { 10, 0 };
#if OSL_DEBUG_LEVEL > 2
osl::Condition::Result aResult =
#endif
- maSizeCondition.wait( &aTimeout );
+ maSizeCondition.wait( std::chrono::seconds(10) );
DBG( "%p Player::getPreferredPlayerWindowSize after waitCondition %d, member %d x %d", this, aResult, mnWidth, mnHeight );
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 9783349f81e6..bb100c290af9 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -18,6 +18,7 @@
*/
#include <boost/bind.hpp>
+#include <chrono>
#include <iostream>
#include <osl/conditn.hxx>
#include <vcl/graph.hxx>
@@ -85,9 +86,7 @@ VLCFrameGrabber::VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString
mPlayer.setTime( ( fMediaTime > 0 ? fMediaTime : 0 ) * MSEC_IN_SEC );
mPlayer.pause();
- const TimeValue timeout = {2, 0};
-
- condition.wait(&timeout);
+ condition.wait(std::chrono::seconds(2));
if ( !mPlayer.hasVout() )
{
diff --git a/include/osl/conditn.hxx b/include/osl/conditn.hxx
index 0859a1419bd6..8bb37e307f2d 100644
--- a/include/osl/conditn.hxx
+++ b/include/osl/conditn.hxx
@@ -80,6 +80,10 @@ namespace osl
return (Result) osl_waitCondition(condition, pTimeout);
}
+#if defined LIBO_INTERNAL_ONLY
+ Result wait(TimeValue const & timeout) { return wait(&timeout); }
+#endif
+
/** Checks if the condition is set without blocking.
*/
bool check()