Skip to content

Commit

Permalink
Exclude examples from experimental build tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrGlad committed Nov 22, 2024
1 parent de53b87 commit bf60185
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'
- run: cargo test --all-targets
- run: cargo test --all-targets --features=experimental
- run: cargo test --lib --bins --tests --benches --features=experimental
- run: cargo test --all-targets --features=symphonia-all
# `cargo test` does not check benchmarks and `cargo test --all-targets` excludes
# documentation tests. Therefore, we need an additional docs test command here.
Expand Down
23 changes: 8 additions & 15 deletions examples/automatic_gain_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,14 @@ fn main() {
// or we would lose it when we move it into the periodic access.
let agc_enabled = Arc::new(AtomicBool::new(true));

#[cfg(not(feature = "experimental"))]
{
let agc_enabled_clone = agc_enabled.clone();
let controlled = agc_source.periodic_access(Duration::from_millis(5), move |agc_source| {
agc_source.set_enabled(agc_enabled_clone.load(Ordering::Relaxed));
});

// Add the source now equipped with automatic gain control and controlled via
// periodic_access to the sink for playback.
sink.append(controlled);
}
#[cfg(feature = "experimental")]
{
sink.append(agc_source);
}
let agc_enabled_clone = agc_enabled.clone();
let controlled = agc_source.periodic_access(Duration::from_millis(5), move |agc_source| {
agc_source.set_enabled(agc_enabled_clone.load(Ordering::Relaxed));
});

// Add the source now equipped with automatic gain control and controlled via
// periodic_access to the sink for playback.
sink.append(controlled);

// After 5 seconds of playback disable automatic gain control using the
// shared AtomicBool `agc_enabled`. You could do this from another part
Expand Down

0 comments on commit bf60185

Please sign in to comment.