Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorJordan Petridis <jordan@centricular.com>2022-12-06 21:28:16 +0300
committerSebastian Dröge <sebastian@centricular.com>2022-12-12 11:51:09 +0300
commit37b0dab0e8bdf39dd82375dd02174ca57effd268 (patch)
tree4c30c6a873c9159f21576f580e88db4f358ec82f /video
parentd9de2d3d7b76320bc438bb40e504f586e05c4945 (diff)
gtk4: Deactivate the context if we fail to fill_info
Avoid leaving the context activated if we end up erroring out. Similar to https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3492 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1001>
Diffstat (limited to 'video')
-rw-r--r--video/gtk4/src/sink/imp.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/gtk4/src/sink/imp.rs b/video/gtk4/src/sink/imp.rs
index ad436af5..992180f3 100644
--- a/video/gtk4/src/sink/imp.rs
+++ b/video/gtk4/src/sink/imp.rs
@@ -670,6 +670,16 @@ impl PaintableSink {
"Failed to fill info on the GL Context: {}",
&err
);
+ // Deactivate the context upon failure
+ if let Err(err) = app_ctx_guard.as_ref().unwrap().activate(false) {
+ gst::error!(
+ CAT,
+ imp: self,
+ "Failed to deactivate the context after failing fill info: {}",
+ &err
+ );
+ }
+
return Err(err);
}
};