protocol/ArgParser: cast seek offset to SignedSongTime

"The issue is that ParseCommandArgSignedSongTime parses with
SongTime::FromS, not SignedSongTime::FromS, before casting back to a
SignedSongTime for the return. With x86 overflow rules this doesn't
matter, but on ARM the first cast turns negative values to zero."

Closes https://github.com/MusicPlayerDaemon/MPD/issues/757
This commit is contained in:
Max Kellermann 2020-02-10 09:18:37 +01:00
parent 42eb69f46f
commit 5397d18ed9
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -3,6 +3,7 @@ ver 0.21.20 (not yet released)
- audiofile, ffmpeg, sndfile: handle MIME type "audio/wav"
- ffmpeg: fix playback of AIFF and TTA
- vorbis, opus: fix seeking in small files
* fix backwards seeking on ARM (and other non-x86 CPUs)
ver 0.21.19 (2020/01/17)
* configuration

View File

@ -175,5 +175,5 @@ SignedSongTime
ParseCommandArgSignedSongTime(const char *s)
{
auto value = ParseCommandArgFloat(s);
return SongTime::FromS(value);
return SignedSongTime::FromS(value);
}