aboutsummaryrefslogtreecommitdiff
path: root/src/playlist
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-06-25 20:01:08 +0200
committerMax Kellermann <max@duempel.org>2010-06-25 20:02:55 +0200
commit1ea10db953f082bee7b40ce3a4d4fd18beeb2a56 (patch)
treefd4c4a17aa78156782357f66ba9c853c981577b8 /src/playlist
parenteb6188f8c07b45fcc99e0c90486e65bba68cc965 (diff)
playlist/cue: last track ends at end of file
libcue's track_get_length() returns 0 for the last track, because that information is not available in the CUE sheet. This makes MPD quit playing the last track immediately. If we set "song.end_ms=0", MPD will play the track until the end of the song file, which is what we want.
Diffstat (limited to 'src/playlist')
-rw-r--r--src/playlist/cue_playlist_plugin.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/playlist/cue_playlist_plugin.c b/src/playlist/cue_playlist_plugin.c
index 75bc5484..b22712bc 100644
--- a/src/playlist/cue_playlist_plugin.c
+++ b/src/playlist/cue_playlist_plugin.c
@@ -105,9 +105,6 @@ cue_playlist_read(struct playlist_provider *_playlist)
song->start_ms = ((track_get_start(track)
+ track_get_index(track, 1)
- track_get_zero_pre(track)) * 1000) / 75;
- song->end_ms = ((track_get_start(track) + track_get_length(track)
- - track_get_index(track, 1)
- + track_get_zero_pre(track)) * 1000) / 75;
/* append pregap of the next track to the end of this one */
track = cd_get_track(playlist->cd, playlist->next);
@@ -115,6 +112,8 @@ cue_playlist_read(struct playlist_provider *_playlist)
song->end_ms = ((track_get_start(track)
+ track_get_index(track, 1)
- track_get_zero_pre(track)) * 1000) / 75;
+ else
+ song->end_ms = 0;
return song;
}