add timeout paramter to DeviceTrait stream builders (#696)
* add timeout paramter to DeviceTrait stream builders This makes it possible for the library client to handle situations where the host takes too long to respond or even blocks forever, eg. a retry can be applied. if the timeout passed is "None" the current behaviour is applied, eg. blocking forever. if the timeout passed is a Duration then it will be applied to the Device Streams. This is only implemented for ALSA, the other hosts will ignore the parameter for now. Signed-off-by: Marc Bodmer <marc.bodmer@securiton.ch>
This commit is contained in:
parent
def424809b
commit
0a3e8c2208
21 changed files with 148 additions and 21 deletions
|
|
@ -202,8 +202,8 @@ fn main() -> anyhow::Result<()> {
|
|||
"Attempting to build both streams with f32 samples and `{:?}`.",
|
||||
config
|
||||
);
|
||||
let input_stream = input_device.build_input_stream(&config, input_data_fn, err_fn)?;
|
||||
let output_stream = output_device.build_output_stream(&config, output_data_fn, err_fn)?;
|
||||
let input_stream = input_device.build_input_stream(&config, input_data_fn, err_fn, None)?;
|
||||
let output_stream = output_device.build_output_stream(&config, output_data_fn, err_fn, None)?;
|
||||
println!("Successfully built streams.");
|
||||
|
||||
// Play the streams.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue