Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/pipewirethread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@ impl ScreencastThread {
let (thread_stop_tx, thread_stop_rx) = pipewire::channel::channel::<()>();
std::thread::spawn(move || {
match start_stream(overlay_cursor, width, height, capture_region, output) {
Ok((loop_, listener, context, node_id_rx)) => {
Ok((loop_, _listener, _context, node_id_rx)) => {
tx.send(Ok(node_id_rx)).unwrap();
let weak_loop = loop_.downgrade();
let _receiver = thread_stop_rx.attach(&loop_, move |()| {
weak_loop.upgrade().unwrap().quit();
});
loop_.run();
// XXX fix segfault with opposite drop order
drop(listener);
drop(context);
}
Err(err) => tx.send(Err(err)).unwrap(),
};
Expand All @@ -62,7 +59,7 @@ impl ScreencastThread {
type PipewireStreamResult = (
pipewire::MainLoop,
pipewire::stream::StreamListener<()>,
pipewire::Context<pipewire::MainLoop>,
pipewire::Context,
oneshot::Receiver<anyhow::Result<u32>>,
);

Expand Down