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

Fix output on big-endian systems #778

Merged
merged 5 commits into from
May 30, 2021

Conversation

roderickvd
Copy link
Member

No idea if anyone is using librespot on big-endian systems, but this makes it so output is always in native endian format. This already was OK on the rest of the backends, and for Alsa it only concerned S24_3.

@JasonLG1979
Copy link
Contributor

Sure why not. Off the top of my head, old Power PC Macs are Big Endian.

@JasonLG1979
Copy link
Contributor

I would assume that lewton decodes to the native endianness of the platform then?

@roderickvd
Copy link
Member Author

I think so. It uses byteorder.

@JasonLG1979
Copy link
Contributor

I think so. It uses byteorder.

It's so hard to really test this. I guess we'll find out if our assumptions are correct or not if it fails for someone on some obscure hardware?

@roderickvd
Copy link
Member Author

Yeah best we can do is a code review. At least this makes it more consistent, because the gating on #[cfg(target_endian = "little|big")] is exactly what alsa::Format::float() and friends do.

Honestly I wouldn't be surprised if no-one were playing on a big-endian system so this is just good housekeeping.

@roderickvd roderickvd changed the title Always output in native endianness Fix output on big-endian systems May 30, 2021
@roderickvd roderickvd merged commit bae1834 into librespot-org:dev May 30, 2021
@roderickvd roderickvd deleted the output-in-native-endianness branch May 30, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants