avmedia/source/gstreamer/gstplayer.cxx | 4 ++-- avmedia/source/vlc/vlcframegrabber.cxx | 5 ++--- include/osl/conditn.hxx | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-)
New commits: commit 26821b7e2eff4a7db22606f70daa3f3d442f7525 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Aug 18 08:22:16 2015 +0200 tdf#84323: Make osl::Condition::wait more readable Change-Id: Icd66ae1d390100549f903d45b2896cdcdca449be diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index eb64d1d..4282833 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 9783349..bb100c2 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 0859a14..8bb37e3 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() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits