aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fl2k.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fl2k.rs b/src/fl2k.rs
index 74357b3..a17a04d 100644
--- a/src/fl2k.rs
+++ b/src/fl2k.rs
@@ -95,7 +95,13 @@ impl FL2K {
}
pub fn set_sample_rate(&mut self, sample_rate: u32) -> Result<(), FL2KError> {
- handle_return_value( unsafe { fl2k_set_sample_rate(self.device, sample_rate) })
+ let r = unsafe { fl2k_set_sample_rate(self.device, sample_rate) };
+ if r < 0 {
+ handle_return_value(r)
+ }
+ else {
+ Ok(())
+ }
}
pub fn get_sample_rate(&mut self) -> Result<u32, FL2KError> {