Fix compilation of iterator example

This commit is contained in:
Sebastian Dröge 2018-08-13 23:46:22 +03:00
parent a6d9fe4b0a
commit 06bd23f833

View file

@ -9,9 +9,13 @@ fn example_main() {
let identity = gst::ElementFactory::make("identity", None).unwrap(); let identity = gst::ElementFactory::make("identity", None).unwrap();
let mut iter = identity.iterate_pads(); let mut iter = identity.iterate_pads();
while let Some(res) = iter.next() { loop {
match res { match iter.next() {
Ok(pad) => println!("Pad: {}", pad.get_name()), Ok(Some(pad)) => println!("Pad: {}", pad.get_name()),
Ok(None) => {
println!("Done");
break;
}
Err(gst::IteratorError::Resync) => { Err(gst::IteratorError::Resync) => {
println!("Iterator resync"); println!("Iterator resync");
iter.resync(); iter.resync();