format/context: fix the packets iterator
This commit is contained in:
parent
1e5d77816a
commit
b712412e77
@ -195,15 +195,19 @@ impl<'a> Iterator for PacketIter<'a> {
|
|||||||
fn next(&mut self) -> Option<<Self as Iterator>::Item> {
|
fn next(&mut self) -> Option<<Self as Iterator>::Item> {
|
||||||
let mut packet = Packet::empty();
|
let mut packet = Packet::empty();
|
||||||
|
|
||||||
match packet.read(self.context) {
|
loop {
|
||||||
Ok(..) => unsafe {
|
match packet.read(self.context) {
|
||||||
let stream = Stream::wrap(*(*self.context.as_ptr()).streams.offset(packet.stream() as isize));
|
Ok(..) =>
|
||||||
|
return Some((unsafe {
|
||||||
|
Stream::wrap(*(*self.context.as_ptr()).streams.offset(packet.stream() as isize))
|
||||||
|
}, packet)),
|
||||||
|
|
||||||
Some((stream, packet))
|
Err(Error::Eof) =>
|
||||||
},
|
return None,
|
||||||
|
|
||||||
_ =>
|
Err(..) =>
|
||||||
None
|
()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user