From 7841e59afc79e91d499f021621f9ad6b3bad9acb Mon Sep 17 00:00:00 2001 From: ejurgensen <espenjurgensen@gmail.com> Date: Sat, 11 Apr 2015 22:38:33 +0200 Subject: [PATCH] Don't report negative remaining times for streams --- src/httpd_dacp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index 63b9cb7c..d52396c3 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -178,7 +178,11 @@ dacp_playingtime(struct evbuffer *evbuf, struct player_status *status, struct me if ((status->status == PLAY_STOPPED) || !mfi) return; - dmap_add_int(evbuf, "cant", mfi->song_length - status->pos_ms); /* Remaining time in ms */ + 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 */ }