Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPD cannot seek backwards on ARM #757

Closed
ecprice opened this issue Feb 8, 2020 · 0 comments
Closed

MPD cannot seek backwards on ARM #757

ecprice opened this issue Feb 8, 2020 · 0 comments
Labels
bug
Milestone

Comments

@ecprice
Copy link

@ecprice ecprice commented Feb 8, 2020

On my raspberry pi, negative seeks, like seekcur -20, do not actually move backwards.

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.

The following patch fixes it:

diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx
index bdbe751f8..fd0c273dc 100644
--- a/src/protocol/ArgParser.cxx
+++ b/src/protocol/ArgParser.cxx
@@ -175,5 +175,5 @@ SignedSongTime
 ParseCommandArgSignedSongTime(const char *s)
 {
 	auto value = ParseCommandArgFloat(s);
-	return SongTime::FromS(value);
+	return SignedSongTime::FromS(value);
 }
@MaxKellermann MaxKellermann added this to the 0.21 milestone Feb 16, 2020
@MaxKellermann MaxKellermann added the bug label Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.