Commit 1ea10db9 authored by Max Kellermann's avatar Max Kellermann

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.
parent eb6188f8
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment