Don't report negative remaining times for streams

This commit is contained in:
ejurgensen 2015-04-11 22:38:33 +02:00
parent 3afd206e93
commit 7841e59afc

View File

@ -178,7 +178,11 @@ dacp_playingtime(struct evbuffer *evbuf, struct player_status *status, struct me
if ((status->status == PLAY_STOPPED) || !mfi)
return;
if (mfi->song_length)
dmap_add_int(evbuf, "cant", mfi->song_length - status->pos_ms); /* Remaining time in ms */
else
dmap_add_int(evbuf, "cant", 0); /* Unknown remaining time */
dmap_add_int(evbuf, "cast", mfi->song_length); /* Song length in ms */
}