mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-04 00:59:32 +02:00
123
git-svn-id: svn://elaine/murooma/trunk@262 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
e4170fa3d8
commit
3a410e49d8
1 changed files with 12 additions and 5 deletions
|
@ -54,23 +54,30 @@ struct tv
|
|||
|
||||
int32_t sec;
|
||||
int32_t usec;
|
||||
5.3 - 6.2 = -0.9
|
||||
-1
|
||||
0.1
|
||||
|
||||
5.3 - 6.4 = -1.1
|
||||
-1
|
||||
-0.1
|
||||
|
||||
tv operator-(const tv& other)
|
||||
{
|
||||
tv result(*this);
|
||||
result.sec -= other.sec;
|
||||
result.usec -= other.usec;
|
||||
if (result.usec < 0)
|
||||
if (result.usec > 0)
|
||||
{
|
||||
result.usec += 1000000;
|
||||
result.sec -= 1;
|
||||
result.sec += 1;
|
||||
result.usec = 1000000 - result.usec;
|
||||
}
|
||||
else if (result.usec >= 1000000)
|
||||
/* else if (result.usec >= 1000000)
|
||||
{
|
||||
result.usec -= 1000000;
|
||||
result.sec += 1;
|
||||
}
|
||||
return result;
|
||||
*/ return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue