libsaria: Return empty string when no song loaded

I was returning "0:00", but I think an empty string looks better.
This commit is contained in:
Bryan Schumaker 2011-11-02 08:22:23 -04:00
parent 1018b0bc5b
commit 9f6320ce18
1 changed files with 6 additions and 2 deletions

View File

@ -79,9 +79,13 @@ namespace libsaria
string audio::posstr()
{
stringstream stream;
int minutes, seconds, pos;
gint64 pos;
int minutes, seconds;
pos = position() / GST_SECOND;
if (!get_position(pos))
return "";
pos = pos / GST_SECOND;
minutes = pos / 60;
seconds = pos - (minutes * 60);
stream << minutes << ":";