Update example based on api changes

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-06-29 09:38:01 +08:00
parent 3c0f2dfed7
commit b45dc606f1
4 changed files with 10 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ fn record(i: usize) {
loop {
// Wait until there's a frame.
let buffer = match capturer.frame(0) {
let buffer = match capturer.frame(Duration::from_millis(0)) {
Ok(buffer) => buffer,
Err(error) => {
if error.kind() == WouldBlock {
@@ -83,7 +83,7 @@ fn record(i: usize) {
loop {
// Wait until there's a frame.
let buffer = match capturer.frame(0) {
let buffer = match capturer.frame(Duration::from_millis(0)) {
Ok(buffer) => buffer,
Err(error) => {
if error.kind() == WouldBlock {