Fix erroneous getStreamTime() results in some cases.
authorCarl Hetherington <cth@carlh.net>
Sat, 19 Mar 2016 21:15:20 +0000 (21:15 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 19 Mar 2016 21:15:20 +0000 (21:15 +0000)
commit949fd03da9e1711e8a3bfb5a7168bc3e5463dbc5
tree955e494324e77bbbc1f8b16fbcf47b12c02561d0
parent02de4000a365ad0591b1f116271741a5815c9ce8
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.
RtAudio.cpp
RtAudio.h