Skip to content

Commit

Permalink
Merge pull request RustAudio#307 from derekdreery/relax_buffer_size
Browse files Browse the repository at this point in the history
Remove the (arbitary) restriction on buffer size
  • Loading branch information
mitchmindtree authored Aug 10, 2019
2 parents 624ca76 + 1c34dd6 commit d3fdb2d
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/host/alsa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,17 +1117,6 @@ unsafe fn set_hw_params_from_format(
return Err(format!("channel count could not be set: {}", e));
}

// TODO: Review this. 200ms seems arbitrary...
let mut max_buffer_size = format.sample_rate.0 as alsa::snd_pcm_uframes_t /
format.channels as alsa::snd_pcm_uframes_t /
5; // 200ms of buffer
if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_buffer_size_max(pcm_handle,
hw_params.0,
&mut max_buffer_size))
{
return Err(format!("max buffer size could not be set: {}", e));
}

if let Err(e) = check_errors(alsa::snd_pcm_hw_params(pcm_handle, hw_params.0)) {
return Err(format!("hardware params could not be set: {}", e));
}
Expand Down

0 comments on commit d3fdb2d

Please sign in to comment.