From: Carl Hetherington Date: Mon, 15 Apr 2019 11:30:52 +0000 (+0100) Subject: Fix erroneous getStreamTime() results in some cases. X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=e46da8995672eda8500a8567c3edcdeef9b44e3d;hp=e46da8995672eda8500a8567c3edcdeef9b44e3d;p=rtaudio-cdist.git Fix erroneous getStreamTime() results in some cases. Without this, if HAVE_GETTIMEOFDAY is defined getStreamTime() can return a wrong value in the following case: - start stream - stop stream - start stream - call getStreamTime() immediately In this case tickStreamTime() will not have been called since the stream was restarted, hence lastTickTimestamp will refer to the previous run of the stream. getStreamTime() will therefore extrapolate wrongly from stream._streamTime. This patch only uses lastTickTimestamp when it is valid. ---