Merge pull request #382 from dansgithubuser/master

fix sample rate range assertion
This commit is contained in:
mitchmindtree 2020-03-18 09:02:34 +01:00 committed by GitHub
commit f3e7c46205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -356,7 +356,7 @@ impl SupportedStreamConfigRange {
/// **panic!**s if the given `sample_rate` is outside the range specified within this /// **panic!**s if the given `sample_rate` is outside the range specified within this
/// `SupportedStreamConfigRange` instance. /// `SupportedStreamConfigRange` instance.
pub fn with_sample_rate(self, sample_rate: SampleRate) -> SupportedStreamConfig { pub fn with_sample_rate(self, sample_rate: SampleRate) -> SupportedStreamConfig {
assert!(sample_rate <= self.min_sample_rate && sample_rate <= self.max_sample_rate); assert!(self.min_sample_rate <= sample_rate && sample_rate <= self.max_sample_rate);
SupportedStreamConfig { SupportedStreamConfig {
channels: self.channels, channels: self.channels,
sample_format: self.sample_format, sample_format: self.sample_format,