Only consider timeouts if configure bigger than 0

Configuring 0 will never time out.
This commit is contained in:
Sebastian Dröge 2020-09-01 21:38:13 +03:00
parent 9d4e427e14
commit 3ea203825a

View file

@ -907,7 +907,7 @@ impl Receiver<VideoReceiver> {
); );
return Err(gst::FlowError::Error); return Err(gst::FlowError::Error);
} }
Ok(None) if timer.elapsed().as_millis() >= timeout as u128 => { Ok(None) if timeout > 0 && timer.elapsed().as_millis() >= timeout as u128 => {
gst_debug!(self.0.cat, obj: element, "Timed out -- assuming EOS",); gst_debug!(self.0.cat, obj: element, "Timed out -- assuming EOS",);
return Err(gst::FlowError::Eos); return Err(gst::FlowError::Eos);
} }
@ -1335,7 +1335,7 @@ impl Receiver<AudioReceiver> {
); );
return Err(gst::FlowError::Error); return Err(gst::FlowError::Error);
} }
Ok(None) if timer.elapsed().as_millis() >= timeout as u128 => { Ok(None) if timeout > 0 && timer.elapsed().as_millis() >= timeout as u128 => {
gst_debug!(self.0.cat, obj: element, "Timed out -- assuming EOS",); gst_debug!(self.0.cat, obj: element, "Timed out -- assuming EOS",);
return Err(gst::FlowError::Eos); return Err(gst::FlowError::Eos);
} }