gtk4: Don't error out when the main context channel does not exist anymore when rendering

But instead return flushing to shut down silently.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1027>
This commit is contained in:
Sebastian Dröge 2022-12-22 20:45:21 +02:00
parent 993619d654
commit e8701652e2

View file

@ -440,12 +440,12 @@ impl VideoSinkImpl for PaintableSink {
let sender = self.sender.lock().unwrap();
let sender = sender.as_ref().ok_or_else(|| {
gst::error!(CAT, imp: self, "Have no main thread sender");
gst::FlowError::Error
gst::FlowError::Flushing
})?;
sender.send(SinkEvent::FrameChanged).map_err(|_| {
gst::error!(CAT, imp: self, "Have main thread receiver shut down");
gst::FlowError::Error
gst::FlowError::Flushing
})?;
Ok(gst::FlowSuccess::Ok)