mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-24 03:27:46 -05:00
[player/dacp/mpd/jsonapi] Combine seek commands into one with mode param
Also changes relative seeking behavior: - seeking behind the the current track only switches to the previous track, if we are not more than 3 seconds into the current track, otherwise starts current track from the beginning - seeking beyond the current track will start the next track from the beginning
This commit is contained in:
@@ -1521,7 +1521,7 @@ mpd_command_seek(struct evbuffer *evbuf, int argc, char **argv, char **errmsg, s
|
||||
seek_target_sec = strtof(argv[2], NULL);
|
||||
seek_target_msec = seek_target_sec * 1000;
|
||||
|
||||
ret = player_playback_seek(seek_target_msec);
|
||||
ret = player_playback_seek(seek_target_msec, PLAYER_SEEK_POSITION);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -1571,7 +1571,7 @@ mpd_command_seekid(struct evbuffer *evbuf, int argc, char **argv, char **errmsg,
|
||||
seek_target_sec = strtof(argv[2], NULL);
|
||||
seek_target_msec = seek_target_sec * 1000;
|
||||
|
||||
ret = player_playback_seek(seek_target_msec);
|
||||
ret = player_playback_seek(seek_target_msec, PLAYER_SEEK_POSITION);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -1604,7 +1604,7 @@ mpd_command_seekcur(struct evbuffer *evbuf, int argc, char **argv, char **errmsg
|
||||
seek_target_msec = seek_target_sec * 1000;
|
||||
|
||||
// TODO If prefixed by '+' or '-', then the time is relative to the current playing position.
|
||||
ret = player_playback_seek(seek_target_msec);
|
||||
ret = player_playback_seek(seek_target_msec, PLAYER_SEEK_POSITION);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user