aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-06-25 20:02:53 +0200
committerMax Kellermann <max@duempel.org>2010-06-25 20:02:55 +0200
commit6bb7a7439dfa01745a7cf67e71d204e3b22926b6 (patch)
treec8b49758b9114463a9599f6b2607c1d355582a34 /src
parentca6110d92fac1cab5f29045a1108efed9174dde4 (diff)
downloadmpd-6bb7a7439dfa01745a7cf67e71d204e3b22926b6.tar.gz
mpd-6bb7a7439dfa01745a7cf67e71d204e3b22926b6.tar.xz
mpd-6bb7a7439dfa01745a7cf67e71d204e3b22926b6.zip
song_print: simplified start_ms/end_ms check
Diffstat (limited to 'src')
-rw-r--r--src/song_print.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/song_print.c b/src/song_print.c
index 034c1d013..11b241fbc 100644
--- a/src/song_print.c
+++ b/src/song_print.c
@@ -51,18 +51,16 @@ song_print_info(struct client *client, struct song *song)
{
song_print_uri(client, song);
- if (song->start_ms > 0 || song->end_ms > 0) {
- if (song->end_ms > 0)
- client_printf(client, "Range: %u.%03u-%u.%03u\n",
- song->start_ms / 1000,
- song->start_ms % 1000,
- song->end_ms / 1000,
- song->end_ms % 1000);
- else
- client_printf(client, "Range: %u.%03u-\n",
- song->start_ms / 1000,
- song->start_ms % 1000);
- }
+ if (song->end_ms > 0)
+ client_printf(client, "Range: %u.%03u-%u.%03u\n",
+ song->start_ms / 1000,
+ song->start_ms % 1000,
+ song->end_ms / 1000,
+ song->end_ms % 1000);
+ else if (song->start_ms > 0)
+ client_printf(client, "Range: %u.%03u-\n",
+ song->start_ms / 1000,
+ song->start_ms % 1000);
if (song->mtime > 0) {
#ifndef G_OS_WIN32