db/LightSong: use std::chrono::duration for start_ms and end_ms

This commit is contained in:
Max Kellermann
2014-08-28 12:35:26 +02:00
parent 6ad933982f
commit 2efd8ef52d
7 changed files with 28 additions and 24 deletions

View File

@@ -23,11 +23,11 @@
double
LightSong::GetDuration() const
{
if (end_ms > 0)
return (end_ms - start_ms) / 1000.0;
if (end_time.IsPositive())
return (end_time - start_time).ToDoubleS();
if (tag->time <= 0)
return 0;
return tag->time - start_ms / 1000.0;
return tag->time - start_time.ToDoubleS();
}