| 485 | } |
| 486 | |
| 487 | double RtApi ::getStreamTime(void) |
| 488 | { |
| 489 | verifyStream(); |
| 490 | |
| 491 | #if defined(HAVE_GETTIMEOFDAY) |
| 492 | // Return a very accurate estimate of the stream time by |
| 493 | // adding in the elapsed time since the last tick. |
| 494 | struct timeval then; |
| 495 | struct timeval now; |
| 496 | |
| 497 | if (stream_.state != STREAM_RUNNING || stream_.streamTime == 0.0) |
| 498 | return stream_.streamTime; |
| 499 | |
| 500 | gettimeofday(&now, NULL); |
| 501 | then = stream_.lastTickTimestamp; |
| 502 | return stream_.streamTime + ((now.tv_sec + 0.000001 * now.tv_usec) - (then.tv_sec + 0.000001 * then.tv_usec)); |
| 503 | #else |
| 504 | return stream_.streamTime; |
| 505 | #endif |
| 506 | } |
| 507 | |
| 508 | void RtApi ::setStreamTime(double time) |
| 509 | { |
nothing calls this directly
no outgoing calls
no test coverage detected