Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db/ProxyDatabasePlugin: read millisecond values for range start and end
Browse files Browse the repository at this point in the history
Range `start` and `end` values in `mpd_song` (libmpdclient) is stored in
seconds only, which makes range times in `ProxySong` truncated to
seconds and leads to precision loss on satellite cue track range times.

This commit reads the added `start_ms` and `end_ms` value from
libmpdclient, which represent range start and end time in milliseconds.
And uses them to set `start_time` and `end_time` of `ProxySong`.
datasone committed Aug 16, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 495f453 commit 0f7ee06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db/plugins/ProxyDatabasePlugin.cxx
Original file line number Diff line number Diff line change
@@ -211,8 +211,8 @@ ProxySong::ProxySong(const mpd_song *song)
if (_mtime > 0)
mtime = std::chrono::system_clock::from_time_t(_mtime);

start_time = SongTime::FromS(mpd_song_get_start(song));
end_time = SongTime::FromS(mpd_song_get_end(song));
start_time = SongTime::FromMS(mpd_song_get_start_ms(song));
end_time = SongTime::FromMS(mpd_song_get_end_ms(song));

const auto *af = mpd_song_get_audio_format(song);
if (af != nullptr) {

0 comments on commit 0f7ee06

Please sign in to comment.