From 126e8c69ffa01339a90b137397b030fd68982c7e Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Mon, 9 Jun 2025 23:13:12 +0200 Subject: [PATCH] fix: minimp3 decoder compilation Add CI check for minimp3 feature and update mp3 decoder to use Sample type instead of DecoderSample. --- .github/workflows/ci.yml | 2 ++ src/decoder/mp3.rs | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1ed0faf..47ff92c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,3 +51,5 @@ jobs: - run: cargo test --doc # Check minimal build. - run: cargo check --tests --lib --no-default-features + # Check alternative decoders. + - run: cargo check --tests --lib --no-default-features --features minimp3 diff --git a/src/decoder/mp3.rs b/src/decoder/mp3.rs index e0680cbf..8e6c6680 100644 --- a/src/decoder/mp3.rs +++ b/src/decoder/mp3.rs @@ -1,11 +1,12 @@ use std::io::{Read, Seek, SeekFrom}; use std::time::Duration; -use super::DecoderSample; -use crate::common::{ChannelCount, SampleRate}; +use crate::common::{ChannelCount, Sample, SampleRate}; use crate::source::SeekError; use crate::Source; +use dasp_sample::Sample as _; + use minimp3::Decoder; use minimp3::Frame; use minimp3_fixed as minimp3; @@ -93,7 +94,7 @@ impl Iterator for Mp3Decoder where R: Read + Seek, { - type Item = DecoderSample; + type Item = Sample; fn next(&mut self) -> Option { let current_span_len = self.current_span_len()?;