From 57e0e56c7170dd7fd0f777faef408aed2de289d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Mon, 27 Apr 2015 09:52:12 +0000 Subject: [PATCH] correct PIBinaryLog play_speed git-svn-id: svn://db.shs.com.ru/pip@121 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- CMakeLists.txt | 2 +- src/io/pibinarylog.cpp | 9 ++++++--- src/io/pibinarylog.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d42367b0..c64ba959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ project(pip) cmake_minimum_required(VERSION 2.6) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) include(CheckFunctionExists) diff --git a/src/io/pibinarylog.cpp b/src/io/pibinarylog.cpp index 238786d5..17fc5fc5 100644 --- a/src/io/pibinarylog.cpp +++ b/src/io/pibinarylog.cpp @@ -146,10 +146,12 @@ bool PIBinaryLog::threadedRead(uchar *readed, int size) { int dtc; if (is_started) { if (delay > 0) { - cdelay = delay / play_speed; + cdelay = delay * play_speed; dtc = int(cdelay) /100; + if (play_speed <= 0.) dtc = 1; for (int j=0; j 0 ? 1. / ps : 0; play_delay = property("playDelay").toSystemTime(); split_mode = (SplitMode)property("splitMode").toInt(); split_time = property("splitTime").toSystemTime(); diff --git a/src/io/pibinarylog.h b/src/io/pibinarylog.h index 7178d2d9..243a8c61 100644 --- a/src/io/pibinarylog.h +++ b/src/io/pibinarylog.h @@ -103,7 +103,7 @@ public: int defaultID() const {return default_id;} //! Returns current play speed - double playSpeed() const {return play_speed;} + double playSpeed() const {return play_speed > 0 ? 1. / play_speed : 0;} //! Returns current play delay PISystemTime playDelay() const {return play_delay;}