[PR #797] [MERGED] Better errors alsa backend #1083

Closed
opened 2026-02-27 20:01:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/797
Author: @JasonLG1979
Created: 6/13/2021
Status: Merged
Merged: 6/18/2021
Merged by: @roderickvd

Base: devHead: better_errors_alsa_backend


📝 Commits (9)

  • 1d78134 Better errors alsa backend
  • 50f067a Get rid of unwrap's in list_outputs and remove use of std::ffi::CString in alsa.rs
  • 50f9630 Bail on fatal errors in player
  • 09429a1 Update CHANGELOG
  • cb30bb3 Some clean up
  • 7754a83 Fix my typo in the change log
  • c3b4da1 Make and error in stopping the sink fatal also.
  • 4bb30c8 Update change log
  • 6675569 Revert impl fmt::Display for AudioFormat

📊 Changes

4 files changed (+187 additions, -61 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 playback/Cargo.toml (+1 -1)
📝 playback/src/audio_backend/alsa.rs (+162 -49)
📝 playback/src/player.rs (+22 -11)

📄 Description

  • Create and use meaningful AlsaError's with thiserror.
  • Remove all usage of unwrap() and expect() from alsa.rs.
  • Handle all errors and never panic! in alsa.rs.
  • Remove the use of std::ffi::CString by using HintIter::new_str instead of HintIter::new.
  • Consider errors in sink.start, sink.stop and sink.write in player.rs as fatal and exit(1).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/797 **Author:** [@JasonLG1979](https://github.com/JasonLG1979) **Created:** 6/13/2021 **Status:** ✅ Merged **Merged:** 6/18/2021 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `better_errors_alsa_backend` --- ### 📝 Commits (9) - [`1d78134`](https://github.com/librespot-org/librespot/commit/1d7813408f7bdb338e9bb17657c116c19d167587) Better errors alsa backend - [`50f067a`](https://github.com/librespot-org/librespot/commit/50f067aa93fddd94a75e56ae51abf47e5f139731) Get rid of unwrap's in list_outputs and remove use of std::ffi::CString in alsa.rs - [`50f9630`](https://github.com/librespot-org/librespot/commit/50f96306f30a014d097ea2ed27d515da541a1339) Bail on fatal errors in player - [`09429a1`](https://github.com/librespot-org/librespot/commit/09429a1780d4914797fe843f1c9fe4b4b63ff394) Update CHANGELOG - [`cb30bb3`](https://github.com/librespot-org/librespot/commit/cb30bb3f3d966a8b7b1f4697faaeb5aadfb8adc7) Some clean up - [`7754a83`](https://github.com/librespot-org/librespot/commit/7754a83519dac7fc2abb3732306f50254be7191c) Fix my typo in the change log - [`c3b4da1`](https://github.com/librespot-org/librespot/commit/c3b4da13e5930050566a9e18334f63ec59b051b8) Make and error in stopping the sink fatal also. - [`4bb30c8`](https://github.com/librespot-org/librespot/commit/4bb30c81b02fdd725c8873809748f4ac3e0d1c4d) Update change log - [`6675569`](https://github.com/librespot-org/librespot/commit/6675569c64b852849e593aa6b82a706506143827) Revert impl fmt::Display for AudioFormat ### 📊 Changes **4 files changed** (+187 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `playback/Cargo.toml` (+1 -1) 📝 `playback/src/audio_backend/alsa.rs` (+162 -49) 📝 `playback/src/player.rs` (+22 -11) </details> ### 📄 Description * Create and use meaningful `AlsaError`'s with `thiserror`. * Remove all usage of `unwrap()` and `expect()` from `alsa.rs`. * Handle all errors and never `panic!` in `alsa.rs`. * Remove the use of `std::ffi::CString` by using `HintIter::new_str` instead of `HintIter::new`. * Consider errors in `sink.start`, `sink.stop` and `sink.write` in `player.rs` as fatal and `exit(1)`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1083
No description provided.