summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1e3e68)
raw | patch | inline | side by side (parent: d1e3e68)
author | Max Kellermann <max@duempel.org> | |
Sat, 14 Nov 2009 01:44:45 +0000 (02:44 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 14 Nov 2009 01:44:45 +0000 (02:44 +0100) |
If the display_remaining_time option is enabled, apply this setting
even during seeking.
even during seeking.
NEWS | patch | blob | history | |
src/status_bar.c | patch | blob | history |
index 4e7906d3acef0a5d26044e9cd978580f1950987d..c48e9dfe360fedebfdc2c4322139c05e7960aace 100644 (file)
--- a/NEWS
+++ b/NEWS
* screen_browser: different colors for directories and playlists
* screen_browser: display song duration
* screen_queue: move ranges with one single "move" command
+* status_bar: fix display_remaining_time while seeking
ncmpc 0.15 - 2009-09-24
diff --git a/src/status_bar.c b/src/status_bar.c
index 2803b28745a8f1214ad69759402f781a89bb2277..2bb3057479d312b66532937fafc5f2259851e166 100644 (file)
--- a/src/status_bar.c
+++ b/src/status_bar.c
if (seek_id >= 0 &&
seek_id == mpd_status_get_song_id(status))
elapsedTime = seek_target_time;
- else if (options.display_remaining_time)
- elapsedTime = total_time -
- mpd_status_get_elapsed_time(status);
else
elapsedTime = mpd_status_get_elapsed_time(status);
+ if (options.display_remaining_time)
+ elapsedTime = elapsedTime < total_time
+ ? total_time - elapsedTime
+ : 0;
+
/* display bitrate if visible-bitrate is true */
#ifndef NCMPC_MINI
format_bitrate(bitrate, sizeof(bitrate), status);